From 33c48616a8c32b1b75c65ee25c57d176f8bf01f7 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 (cherry picked from commit 419bea67ddc941a28ac9eace93b9566ff9239dc0) --- 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