mirror of
https://github.com/nextcloud/server.git
synced 2026-03-18 00:23:20 -04:00
feat(files_reminders): add verbose date string util
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
10a921ea33
commit
419bea67dd
1 changed files with 15 additions and 0 deletions
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue