- Fixed an issue with the required date format for the start and end date when fetching the google events

This commit is contained in:
Dejan
2024-10-05 21:41:40 +02:00
parent d9853481de
commit 6ad587ef31

View File

@ -59,13 +59,17 @@ const CalendarSettingsPage = (props: {
fetchGoogleCalendarEvents(
profileData?.googleToken,
timeMin.toISOString(),
timeMax.toISOString(),
timeMin.toISOString().slice(0, -5) + "Z",
timeMax.toISOString().slice(0, -5) + "Z",
).then((response) => {
response?.forEach((item) => createEvent(item));
response?.forEach((item) => saveData(item));
});
};
async function saveData(item) {
await createEvent(item);
}
const fetchAndSaveMicrosoftEvents = () => {
const startDateTime = new Date(new Date().setHours(0, 0, 0, 0));
const endDateTime = new Date(