ivan-lednev / obsidian-day-planner

An Obsidian plugin for day planning with a clean UI and a simple task format
MIT License
1.93k stars 485 forks source link

Google Calendar Repeating/Recurring Events are Offset by a Day #443

Open Scriptception opened 2 months ago

Scriptception commented 2 months ago

Describe the bug Repeating/Recurring events in Google Calendar are offset by one day (Obsidian is showing them 1 day ahead of google calendar).

To Reproduce Steps to reproduce the behavior:

  1. Create a repeating event in google calendar, i.e. Event named "TEST" that repeats weekly on Monday
  2. Sync via Day Planner plugin in Obsidian
  3. Note the offset between the event in Obsidian, and the event in Google calendar. The duration is correct, but the day is off.

Expected behavior Expected 1:1 start and end date timestamps.

Screenshots Screenshot 2024-04-29 105625

Additional context

Scriptception commented 2 months ago

I suspect that the issue is related to timezones, as recurring events that occur after a certain time work as expected. This is likely because the time calculations for these events remain within the same day, avoiding any timezone-related discrepancies. In other words, the time difference subtractions work correctly when the events occur on the same day, but there might be an issue when crossing over to a new day or timezone boundary.

I just can't find where in the code the issue lies.

image

ivan-lednev commented 2 months ago

Hello, @Scriptception, yeah, timezones are a huge pain. I use a library for this, but it still requires some tinkering to get it right.

Scriptception commented 2 months ago

@ivan-lednev Any pointers as to where I might look in the code to attempt to fix this? I'm happy to attempt to fix myself and make a PR.