Skip to content

Commit

Permalink
feat(files_reminders): add verbose date string util
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Aug 9, 2023
1 parent 10a921e commit 419bea6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/files_reminders/src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

0 comments on commit 419bea6

Please sign in to comment.