Fix UTC/GMT parsing, what the heck was I thinking when I wrote that

This commit is contained in:
Ean Milligan 2024-05-21 03:20:01 -04:00
parent 123aaa89a0
commit cd95894691
1 changed files with 2 additions and 2 deletions

View File

@ -134,8 +134,8 @@ const parseEventTimeZone = (preParsedEventTimeZone: string): [string, string] =>
addPlusSign = true;
}
// Determine if we need to prepend UTC/GMT, handle adding the + into the string
if (!preParsedEventTimeZone.startsWith('UTC') && preParsedEventTimeZone.startsWith('GMT')) {
preParsedEventTimeZone = `UTC${addPlusSign && '+'}${preParsedEventTimeZone}`;
if (!preParsedEventTimeZone.startsWith('UTC') || preParsedEventTimeZone.startsWith('GMT')) {
preParsedEventTimeZone = `UTC${addPlusSign ? '+' : ''}${preParsedEventTimeZone.startsWith('GMT') ? preParsedEventTimeZone.slice(3) : preParsedEventTimeZone}`;
} else if (addPlusSign) {
preParsedEventTimeZone = `${preParsedEventTimeZone.slice(0, 3)}+${preParsedEventTimeZone.slice(3)}`;
}