Skip to content

Fix #110: Remove double DST adjustment in addHoursWithDST()#116

Merged
thedhanawada merged 1 commit intomasterfrom
fix/issue-110-addhours-dst
Mar 20, 2026
Merged

Fix #110: Remove double DST adjustment in addHoursWithDST()#116
thedhanawada merged 1 commit intomasterfrom
fix/issue-110-addhours-dst

Conversation

@thedhanawada
Copy link
Copy Markdown
Collaborator

Fix

Removed the redundant DST offset adjustment block from addHoursWithDST() (DateUtils.js:517-523).

UTC millisecond arithmetic (setTime() with millis) is inherently DST-agnostic — it operates on absolute time. The previous code added hours correctly via UTC millis, then applied an additional DST offset correction that shifted the result by the DST delta (typically +/- 1 hour), producing incorrect times when crossing DST boundaries.

Files Changed

  • core/calendar/DateUtils.js — removed 10 lines, added 3 lines

Fixes #110

addHoursWithDST() added hours via UTC milliseconds (which is already
DST-agnostic) then applied an additional DST offset correction. This
double-adjustment caused times crossing DST boundaries to be off by
the DST delta (typically 1 hour).

Removed the redundant adjustment since UTC millisecond arithmetic
inherently handles DST transitions correctly.

Fixes #110
@thedhanawada thedhanawada merged commit bea9c28 into master Mar 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateUtils.addHoursWithDST() double-adjusts for DST transitions

1 participant