You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Closing this since it's such a late reply... I hope you found your answer somehow!
It's hard to answer without knowing what type of value is study_frequency. I expect you want to create a rule something like this:
schedule = IceCube::Schedule.new do |s|
s.add_recurrence_rule(IceCube::Rule.daily(current_user.study_frequency)
end
@user_schedule = schedule.next_occurrence
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
The text was updated successfully, but these errors were encountered: