Skip to content

Fix #109: DateUtils.isDST() logic is inverted#115

Merged
thedhanawada merged 1 commit intomasterfrom
fix/issue-109-isdst-inverted
Mar 20, 2026
Merged

Fix #109: DateUtils.isDST() logic is inverted#115
thedhanawada merged 1 commit intomasterfrom
fix/issue-109-isdst-inverted

Conversation

@thedhanawada
Copy link
Copy Markdown
Collaborator

Fix

Changed Math.max() to Math.min() in DateUtils.isDST() (line 500).

The DST offset is the minimum of January/July offsets (more negative = further ahead). The previous code compared against Math.max(), which is the standard (winter) offset, causing the function to return true during standard time and false during DST.

Files Changed

  • core/calendar/DateUtils.js — 1 line changed

Fixes #109

isDST() compared current offset against Math.max(janOffset, julOffset),
but the maximum offset is the standard (non-DST) offset. DST offset is
the minimum. Changed to Math.min() so the function returns true during
DST and false during standard time.

Fixes #109
@thedhanawada thedhanawada merged commit add253a 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.isDST() logic is inverted — returns true when NOT in DST

1 participant