seejohnrun/ice_cube — Issue #37: Creating daily rule error message
Author: alexkroman
Created: 2011-10-21 20:17:22+00:00
State: open

I'm having trouble listing daily occurrences with the following code:

```require 'rubygems'
require 'ice_cube'

start = Time.local(2011, 10, 21)
schedule = IceCube::Schedule.new(start)
schedule.rrule IceCube::Rule.daily

schedule.occurrences_between(start, Time.local(2012, 12, 1)).each do |o|
p o
end```

This returns this error message:

/Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/rules/daily_rule.rb:9:in `in_interval?': private method `to_date' called for Fri Oct 21 00:00:00 -0700 2011:Time (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/rule_occurrence.rb:61:in `succ'
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/rule_occurrence.rb:79:in `find_occurrences'
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/rule_occurrence.rb:15:in `between'
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/schedule.rb:241:in `occurrences_between'
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/schedule.rb:240:in `each'
from /Library/Ruby/Gems/1.8/gems/ice_cube-0.6.14/lib/ice_cube/schedule.rb:240:in `occurrences_between'
from cube.rb:8