Hey! I’m close to ultimate Notion ↔ Google Calendar sync. But when I need to update GCal time, I have a problem.
Describe the problem
On update, GCal adds N hours to start/end, where N is Timezone. And there’s no option to disable this, like in “Get many events” operation.
I have +6 hours Timezone. So instead of 15:00-16:00 it’s updated to 21:00-22:00.
There is no such a problem on create an event. , So my workaround is very straight and stupid. Delete the event, create a new one, update the backward id in Notion.
I think, the Update Gcal needs some rework to add Timezone accounting. “Create new” is ok, and “Update” just messes time up. I can’t fix that changing timezones, it will break other processes. The only thing I see is offsetting time in the expression by the Timezone amount. I have no clue how to do that
Hey @giulioandreini Unfortunately, this hardcoding doesn’t help at all. I need a solution that counts for any the Timezone settings, not just hardcoded 6 hours.
This is why I ask you to take a closer look to this broken behavior. Maybe create a PR for that.
“Create event” works fine. “Update event” must work in the same manner, but it doesn’t.
I cannot replicate the different behavior bewteen the two nodes. Maybe you can help me replicate that so we can fix it.
What I did:
set the timezone of my workflow as +6 (just for the sake of testing)
create a set node that sets start and end dates (starting from the current date and adding days/hours)
create a Cal event with those start/end dates
then update the same event using the same start/end dates
What I observe is that the two events (newly created and updated) have the same time (apart from a few seconds between the two executions of the workflow). So it looks to me that Create and Update are handling dates (with timezone) in the same way.
Can you provide more details on how to spot the different behavior?
I used date in this format: “2023-09-15 22:00:00”
It’s fine for the Event create (timezone is counted).
It’s not working for the Event update (timezone is not counted and added)
But when it’s given in “2023-09-15T22:00:00.000+06:00” format, it’s fine for both. I used Luxon to set dates like that.
So, for date like “2023-09-15 22:00:00” the Update event operation works pretty bad.
Now it’s clear, the different behavior is there when the timezone is not specified in the ISO date string.
I already created a ticket in our internal system.
Also glad to see you found a solution using Luxon.
All the best