Fix of errors: automatic and some manual

This commit is contained in:
2024-11-04 19:56:03 +01:00
parent 90798b12e5
commit f05c25853c
41 changed files with 101 additions and 148 deletions

View File

@@ -37,7 +37,7 @@ export const ISOToDate = (str: string|null): Date|null => {
return null;
}
let
const
[year, month, day] = str.split('-').map(p => parseInt(p));
return new Date(year, month-1, day, 0, 0, 0, 0);
@@ -52,7 +52,7 @@ export const ISOToDatetime = (str: string|null): Date|null => {
return null;
}
let
const
[cal, times] = str.split('T'),
[year, month, date] = cal.split('-').map(s => parseInt(s)),
[time, timezone] = times.split(times.charAt(8)),
@@ -91,7 +91,7 @@ export const datetimeToISO = (date: Date): string => {
Math.abs(date.getTimezoneOffset() % 60).toString().padStart(2, '0'),
].join('');
let x = cal + 'T' + time + offset;
const x = cal + 'T' + time + offset;
return x;
};