From 419bea67ddc941a28ac9eace93b9566ff9239dc0 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Wed, 2 Aug 2023 19:15:01 -0700 Subject: [PATCH] feat(files_reminders): add verbose date string util Signed-off-by: Christopher Ng --- apps/files_reminders/src/shared/utils.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, + ) +} -- 2.39.5