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

How to use ice cube next_occurence method? #103

Open
vincentcordel opened this issue May 9, 2016 · 0 comments
Open

How to use ice cube next_occurence method? #103

vincentcordel opened this issue May 9, 2016 · 0 comments

Comments

@vincentcordel
Copy link

vincentcordel commented May 9, 2016

Hi there,

I'm storing a user schedule in the User model (field: study_frequency).

I don't know how to display the next occurence.

I tried (naively):
current_user.study_frequency.next_occurence(Time.now)

I also tried creating a IceCube object first:
schedule = IceCube::Schedule.new(now = Time.now) do |s|
s.add_recurrence_rule(current_user.study_frequency)
end
@user_schedule = schedule.next_occurrence(Time.now)

None of them worked. I'm sure I'm missing something obvious but can't figure out what.

Any advice?

Thanks!

  • Vincent
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