Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#398 Fix double DST occurrences #404

Merged
merged 6 commits into from
Jul 10, 2017

Conversation

avit
Copy link
Collaborator

@avit avit commented Jul 9, 2017

Simplify the method we use for calculating time changes across DST boundaries by
performing arithmetic under UTC to get "absolute" values. This is a revert of
the "unrolling in pairs" method introduced in c93fa7e for fixing #189.

The method of converting to UTC and back for doing time arithmetic only applies
when DST needs to be taken into consideration. For rules with less than daily
intervals, both hours still need to occur. This distinction was added in the
original fix.

However, the method was not correctly tested for non-ActiveSupport times (local
system TZ) and the advancing of time to the next occurrence was validating both
the last DT hour (before fall back) and first ST hour (after fall back) causing
double occurrences for the "same" hour on the clock face.

avit added 6 commits July 6, 2017 09:04
Simplify the method we use for calculating time changes across DST boundaries by
performing arithmetic under UTC to get "absolute" values. This is a revert of
the "unrolling in pairs" method introduced in c93fa7e for fixing ice-cube-ruby#189.

The method of converting to UTC and back for doing time arithmetic only applies
when DST needs to be taken into consideration. For rules with less than daily
intervals, both hours still need to occur. This distinction was added in the
original fix.

However, the method was not correctly tested for non-ActiveSupport times (local
system TZ) and the advancing of time to the next occurrence was validating both
the last DT hour (before fall back) and first ST hour (after fall back) causing
double occurrences for the "same" hour on the clock face.

Fixes ice-cube-ruby#398
@avit avit merged commit 38bb026 into ice-cube-ruby:master Jul 10, 2017
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.

1 participant