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

Stream contains an occurrence even though the start time should have filtered it out #308

Open
marcojulian opened this issue Feb 18, 2025 · 0 comments

Comments

@marcojulian
Copy link

When creating a schedule without a recurrence rule, the occurrence is in the sequence even if the start time passed to occurrences/2 is later than the start time passed to new/2.

iex> schedule = Cocktail.Schedule.new(~U[2025-02-10 00:00:00Z])
#Cocktail.Schedule<>
iex> schedule |> Cocktail.Schedule.occurrences |> Enum.take(1)
[~U[2025-02-10 00:00:00Z]]
iex> schedule |> Cocktail.Schedule.occurrences(~U[2025-02-15 00:00:00Z]) |> Enum.take(1)
[~U[2025-02-10 00:00:00Z]]

Expected result:

iex> schedule = Cocktail.Schedule.new(~U[2025-02-10 00:00:00Z])
#Cocktail.Schedule<>
iex> schedule |> Cocktail.Schedule.occurrences |> Enum.take(1)
[~U[2025-02-10 00:00:00Z]]
iex> schedule |> Cocktail.Schedule.occurrences(~U[2025-02-15 00:00:00Z]) |> Enum.take(1)
[]
@marcojulian marcojulian changed the title Stream contains only one occurrence even though the start time should have filtered it out Stream contains an occurrence even though the start time should have filtered it out Feb 18, 2025
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

No branches or pull requests

1 participant