mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 18:14:59 +00:00
Fix of errors: automatic and some manual
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user