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

Ending Date In Past #25

Open
eric1234 opened this issue Dec 20, 2024 · 0 comments
Open

Ending Date In Past #25

eric1234 opened this issue Dec 20, 2024 · 0 comments

Comments

@eric1234
Copy link

If the schedule indicates an ending date then such as in the future everything works as expected:

Tickle.parse("every monday until Jan 1st, 2027")
=> {:next=>2024-12-23 12:00:00 -0500, :expression=>"monday", :starting=>2024-12-20 15:27:16.556525636 -0500, :until=>2027-01-01 12:00:00 -0500}

My sort of naive strategy is to just ask for the "next" date and keep doing that until I get nil or an error (my assumption once we move past Jan 1st, 2027). Testing that by using a year in the past shows this strategy doesn't work:

Tickle.parse("every monday until Jan 1st, 2024")
=> {:next=>2024-12-23 12:00:00 -0500, :expression=>"monday", :starting=>2024-12-20 15:34:12.15277663 -0500, :until=>2025-01-01 12:00:00 -0500} 

Note how it gave a next date that is after my end date and it thinks the end date is 1/1/2025. Best I can think to do is capture the until value when I first ask for the schedule since at some point that becomes unreliable. But just wondering if I am missing something.

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