Skip to content

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

Description

@marcojulian

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)
[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions