- 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( fetchGoogleCalendarEvents(
profileData?.googleToken, profileData?.googleToken,
timeMin.toISOString(), timeMin.toISOString().slice(0, -5) + "Z",
timeMax.toISOString(), timeMax.toISOString().slice(0, -5) + "Z",
).then((response) => { ).then((response) => {
response?.forEach((item) => createEvent(item)); response?.forEach((item) => saveData(item));
}); });
}; };
async function saveData(item) {
await createEvent(item);
}
const fetchAndSaveMicrosoftEvents = () => { const fetchAndSaveMicrosoftEvents = () => {
const startDateTime = new Date(new Date().setHours(0, 0, 0, 0)); const startDateTime = new Date(new Date().setHours(0, 0, 0, 0));
const endDateTime = new Date( const endDateTime = new Date(