-
Notifications
You must be signed in to change notification settings - Fork 30
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
Daylight savings occurrences bug #304
Comments
i believe validation = %Cocktail.Validation.Day{days: [1, 3, 5]}
timezone = "America/Toronto"
start_time = DateTime.new!(~D[2023-01-01], ~T[00:00:00], timezone)
time1 = DateTime.new!(~D[2024-03-06], ~T[00:00:00], timezone)
time2 = DateTime.new!(~D[2024-03-10], ~T[00:00:00], timezone) iex> Cocktail.Validation.Day.next_time(validation, time1, start_time)
{:no_change, #DateTime<2024-03-06 00:00:00-05:00 EST America/Toronto>}
iex> Cocktail.Validation.Day.next_time(validation, time2, start_time)
{:change, #DateTime<2024-03-10 00:00:00-05:00 EST America/Toronto>}
|
i was able to find the culprit, it's iex> time = DateTime.new!(~D[2024-03-10], ~T[00:00:00], timezone)
#DateTime<2024-03-10 00:00:00-05:00 EST America/Toronto>
iex> Cocktail.Util.shift_time(time, days: 1)
#DateTime<2024-03-10 23:00:00-04:00 EDT America/Toronto>
iex> Timex.shift(time, days: 1)
#DateTime<2024-03-11 00:00:00-04:00 EDT America/Toronto> this is what causes the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi all, first of all—thank you for a wonderful library!
i've encountered what seems to be a daylight savings issue in
0.10.3
when trying to generate occurences across the daylight savings boundary. when attempting to pull DateTimes after the boundary the stream seems to enter some sort of infinite loop and does not return. here's a reproduction:note: daylight savings begins on March 10, 2024. so if we take take the first four occurrences they should fall just before the boundary:
now, the next occurrence should fall on March 11, 2024, if we attempt to take the first five occurrences the code will hang indefinitely:
The text was updated successfully, but these errors were encountered: