Update time calculations in BannerComponent and TicketNormalizer

Refactored BannerComponent to use an imported date function, improved time calculation logic, and enhanced code readability. Also, updated TicketNormalizer to properly normalize various datetime and user-related fields. A new date validation check has been added in the date utility file.
This commit is contained in:
2024-06-01 00:31:39 +02:00
parent 498572b96e
commit ac4e2e5bf2
3 changed files with 23 additions and 8 deletions

View File

@@ -59,6 +59,10 @@ export const ISOToDatetime = (str: string|null): Date|null => {
[hours, minutes, seconds] = time.split(':').map(s => parseInt(s));
;
if ('0000' === timezone) {
return new Date(Date.UTC(year, month-1, date, hours, minutes, seconds));
}
return new Date(year, month-1, date, hours, minutes, seconds);
}