]> 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)
committerChristopher Ng <chrng8@gmail.com>
Wed, 9 Aug 2023 17:41:18 +0000 (10:41 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
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,
+       )
+}