obsidian-day-planner icon indicating copy to clipboard operation
obsidian-day-planner copied to clipboard

Switch to standard time (from summer time) causes tasks to be shifted by one hour in the timeline

Open gigalasr opened this issue 6 months ago • 6 comments

Please check that this issue hasn't been reported before.

  • [x] I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

A Task with a duration from x until y should show up from x until y in the timeline.

Current behaviour

However the task currently shows up at x-1 til y-1

Image

Steps to reproduce

Set your time zone to Central European Standard Time (GMT+1) / MEZ

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [x] Linux
  • [ ] macOS
  • [ ] Windows

Obsidian Version

1.9.14

Possible solution

No response

gigalasr avatar Oct 26 '25 10:10 gigalasr

Same on macOS and iOS (Obsidian 1.10.1). Both previously created tasks and newly added tasks. ICS entries display correctly.

brsma avatar Oct 26 '25 10:10 brsma

The Problem seems to arise from the use of window.moment.startOf('day') as this function returns the wrong Time Zone

Image

and that is used

  • here: https://github.com/ivan-lednev/obsidian-day-planner/blob/7239aa8842bbe6dd6babc5acc1070f4fb666741c/src/util/moment.ts#L10C1-L12C2
  • and here: https://github.com/ivan-lednev/obsidian-day-planner/blob/7239aa8842bbe6dd6babc5acc1070f4fb666741c/src/ui/hooks/use-task-visuals.ts#L21C5-L23C37

to calculate the offset from the top

gigalasr avatar Oct 26 '25 10:10 gigalasr

Oh I think this issue is only relevant today (and all future time switches). window.moment.startOf('day') correctly returns the summer time, because the start of this day was still in summer time! The switch happens at 03:00, so only after that the time zone will be standard time again.

gigalasr avatar Oct 26 '25 11:10 gigalasr

It's back to normal today, indeed.

brsma avatar Oct 27 '25 09:10 brsma

Getting this bug today (DST ended at 2 AM for most of the US). Not a big deal if it's only for a day, but it would be nice to have a fix for the future.

GalladeGuy avatar Nov 02 '25 18:11 GalladeGuy

Having the same behavior today on Windows and iPad OS. I assume it's from the time change.

Luthien22 avatar Nov 03 '25 01:11 Luthien22