Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Aug 2, 2024
1 parent 12a5251 commit cc11304
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/util/date-time/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,7 @@ export function formatDate(
if (isNaN(value as NzSafeAny)) return '';

const langOpt = { locale: options?.locale };
return formatString === 'fn' ? formatDistanceToNow(value, langOpt) : format(value, formatString, langOpt);
return formatString === 'fn'
? formatDistanceToNow(value, langOpt)
: (options?.customFormat ?? format)(value, formatString, langOpt);
}

0 comments on commit cc11304

Please sign in to comment.