diff options
author | Christopher Ng <chrng8@gmail.com> | 2023-08-02 19:15:01 -0700 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2023-08-09 10:41:18 -0700 |
commit | 419bea67ddc941a28ac9eace93b9566ff9239dc0 (patch) | |
tree | 8039477818b452b81912d4e04d13a1c5955fccfa /apps/files_reminders | |
parent | 10a921ea33450c143a0c2d8c5e72e1c5d59dff28 (diff) | |
download | nextcloud-server-419bea67ddc941a28ac9eace93b9566ff9239dc0.tar.gz nextcloud-server-419bea67ddc941a28ac9eace93b9566ff9239dc0.zip |
feat(files_reminders): add verbose date string util
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/files_reminders')
-rw-r--r-- | apps/files_reminders/src/shared/utils.ts | 15 |
1 files changed, 15 insertions, 0 deletions
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, + ) +} |