added tooling (eslint, typescript and prettier)

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-11-02 12:14:37 +01:00
parent 575b3c23bf
commit 493e1b7650
82 changed files with 1890 additions and 1363 deletions

View File

@@ -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);
}