From: Christopher Ng Date: Thu, 3 Aug 2023 02:15:01 +0000 (-0700) Subject: feat(files_reminders): add verbose date string util X-Git-Tag: v27.1.0beta2~35^2~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=33c48616a8c32b1b75c65ee25c57d176f8bf01f7;p=nextcloud-server.git feat(files_reminders): add verbose date string util Signed-off-by: Christopher Ng (cherry picked from commit 419bea67ddc941a28ac9eace93b9566ff9239dc0) --- diff --git a/apps/files_reminders/src/shared/utils.ts b/apps/files_reminders/src/shared/utils.ts index 52d8c2af882..368c1db18c6 100644 --- a/apps/files_reminders/src/shared/utils.ts +++ b/apps/files_reminders/src/shared/utils.ts @@ -110,3 +110,18 @@ export const getDateString = (dueDate: Date): string => { localeOptions, ) } + +export const getVerboseDateString = (dueDate: Date): string => { + const localeOptions: Intl.DateTimeFormatOptions = { + weekday: 'long', + hour: 'numeric', + minute: '2-digit', + month: 'long', + day: 'numeric', + } + + return dueDate.toLocaleString( + getCanonicalLocale(), + localeOptions, + ) +}