added tooling (eslint, typescript and prettier)
This commit is contained in:
@@ -10,11 +10,11 @@ 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) {
|
||||
@@ -23,10 +23,10 @@ export function formatDate(date: Date) {
|
||||
|
||||
export function formatDateTime(date: Date) {
|
||||
return new Intl.DateTimeFormat(getLocale(), {
|
||||
day: "numeric",
|
||||
month: "numeric",
|
||||
year: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
day: 'numeric',
|
||||
month: 'numeric',
|
||||
year: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user