Skip to content

Instantly share code, notes, and snippets.

@seejohnrun
Created May 24, 2011 20:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save seejohnrun/989606 to your computer and use it in GitHub Desktop.
Save seejohnrun/989606 to your computer and use it in GitHub Desktop.
ice_cube 9-5
s = IceCube::Schedule.new(Time.now, :duration => 3600 * 7)
s.add_recurrence_rule IceCube::Rule.daily.day(:monday, :tuesday, :wednesday, :thursday, :friday).hour_of_day(9)
s.occurring_at?(Time.new(2011, 5, 30, 10, 0, 0)) # true, monday at 10am
s.occurring_at?(Time.new(2011, 5, 29, 10, 0, 0)) # false, sunday at 10am
s.occurring_at?(Time.new(2011, 5, 30, 8, 0, 0)) # false, monday at 8am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment