Skip to content

Conversation

@Bodigrim
Copy link
Contributor

@Bodigrim Bodigrim commented Jan 9, 2026

To add months and years addToClockTime converts clock time to calendar time and then back.
As reported at #18, there seems to be some issues with accounting for daylight saving time, which manifest themselves in addToClockTime noTimeDiff actually shifting the time by one hour.

The implementation of toClockTime certainly takes shortcuts, but I'd rather not to touch it, there is not enough test coverage. Instead this patch implements a workaround, eliminating the issue in many practical scenarios: if months and years to be added are zero then just skip conversion to calendar time and back.

…cases

To add months and years `addToClockTime` converts clock time
to calendar time and then back.
As reported at #18,
there seems to be some issues with accounting for daylight saving
time, which manifest themselves in `addToClockTime noTimeDiff`
actually shifting the time by one hour.

The implementation of `toClockTime` certainly takes shortcuts,
but I'd rather not to touch it, there is not enough test coverage.
Instead this patch implements a workaround, eliminating the issue
in many practical scenarios: if months and years to be added are zero
then just skip conversion to calendar time and back.
@Bodigrim Bodigrim merged commit 3f0e299 into master Jan 13, 2026
14 checks passed
@Bodigrim Bodigrim deleted the workaround-addToClockTime branch January 13, 2026 23:43
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.

3 participants