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

TimeUtil.serialize_time doesn't support Occurrences #494

Open
bennettaur opened this issue Feb 22, 2021 · 0 comments
Open

TimeUtil.serialize_time doesn't support Occurrences #494

bennettaur opened this issue Feb 22, 2021 · 0 comments

Comments

@bennettaur
Copy link

bennettaur commented Feb 22, 2021

Maybe this is more of a feature request, but I'm looping through occurrences and based on a set of criteria, I want to add that occurrence as an exception time. Everything allows me to, but when I go to serialize the schedule it fails with ArgumentError: cannot serialize "2017-10-15T00:00:00.000Z", expected a Time. This is easily overcome if I use .to_time or .start_time but it seems natural for occurrences to be supported

example code:

schedule.next_occurrences(10).map do |occurrence|
    if add_exception?(occurrence)
        schedule.add_exception_time(occurrence)
    end
end
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