diff --git a/calendar-integration/google-calendar-utils.js b/calendar-integration/google-calendar-utils.js index 93a1e75..c5dddbd 100644 --- a/calendar-integration/google-calendar-utils.js +++ b/calendar-integration/google-calendar-utils.js @@ -15,19 +15,12 @@ export async function fetchGoogleCalendarEvents(token, startDate) { const start = item.start; let startDateTime; if (start !== undefined) { - const timezone = start.timeZone; if (start.dateTime) { const stringDate = start.dateTime; - startDateTime = new Date(stringDate).toLocaleString("en-us", { - ...options, - timeZone: timezone, - }); + startDateTime = new Date(stringDate); } else { const stringDate = start.date; - startDateTime = new Date(stringDate).toLocaleString("en-us", { - ...options, - timeZone: timezone, - }); + startDateTime = new Date(stringDate); isAllDay = true; } } @@ -35,19 +28,12 @@ export async function fetchGoogleCalendarEvents(token, startDate) { const end = item.end; let endDateTime; if (end !== undefined) { - const timezone = end.timeZone; if (end.dateTime) { const stringDate = end.dateTime; - endDateTime = new Date(stringDate).toLocaleString("en-us", { - ...options, - timeZone: timezone, - }); + endDateTime = new Date(stringDate); } else { const stringDate = end.date; - endDateTime = new Date(stringDate).toLocaleString("en-us", { - ...options, - timeZone: timezone, - }); + endDateTime = new Date(stringDate); } } @@ -63,13 +49,3 @@ export async function fetchGoogleCalendarEvents(token, startDate) { return googleEvents; } - -const options = { - year: "numeric", - month: "long", - day: "numeric", - hour: "numeric", - minute: "numeric", - second: "numeric", - timeZoneName: "short", -};