Switch to standard time (from summer time) causes tasks to be shifted by one hour in the timeline
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
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
Same on macOS and iOS (Obsidian 1.10.1). Both previously created tasks and newly added tasks. ICS entries display correctly.
The Problem seems to arise from the use of window.moment.startOf('day') as this function returns the wrong Time Zone
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
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.
It's back to normal today, indeed.
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.
Having the same behavior today on Windows and iPad OS. I assume it's from the time change.