]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat(files_reminders): add verbose date string util
authorChristopher Ng <chrng8@gmail.com>
Thu, 3 Aug 2023 02:15:01 +0000 (19:15 -0700)
committerAndy Scherzinger <info@andy-scherzinger.de>
Thu, 10 Aug 2023 10:28:19 +0000 (12:28 +0200)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit 419bea67ddc941a28ac9eace93b9566ff9239dc0)

apps/files_reminders/src/shared/utils.ts

index 52d8c2af8825c329b560ba4a0c8997e8b48312a1..368c1db18c6dd1933e91a79db72741349f21a3a5 100644 (file)
@@ -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,
+       )
+}