From cc113040172f04eb88eafc49194a8cfecf08e16c Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 2 Aug 2024 22:29:52 +0800 Subject: [PATCH] chore: fix --- packages/util/date-time/time.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/util/date-time/time.ts b/packages/util/date-time/time.ts index 03de489435..1b3d40e5db 100644 --- a/packages/util/date-time/time.ts +++ b/packages/util/date-time/time.ts @@ -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); }