simple event list and fix tables on settings
This commit is contained in:
@@ -10,13 +10,23 @@ export function dateDifferanceInDays(date1: Date, date2: Date) {
|
||||
}
|
||||
|
||||
export function getLocale() {
|
||||
if(typeof navigator === 'undefined') {
|
||||
return 'en-US'
|
||||
if (typeof navigator === "undefined") {
|
||||
return "en-US";
|
||||
}
|
||||
|
||||
return navigator.language ?? 'en-US';
|
||||
return navigator.language ?? "en-US";
|
||||
}
|
||||
|
||||
export function formatDate(date: Date) {
|
||||
return new Intl.DateTimeFormat(getLocale()).format(date)
|
||||
}
|
||||
return new Intl.DateTimeFormat(getLocale()).format(date);
|
||||
}
|
||||
|
||||
export function formatDateTime(date: Date) {
|
||||
return new Intl.DateTimeFormat(getLocale(), {
|
||||
day: "numeric",
|
||||
month: "numeric",
|
||||
year: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user