IceCube & Daily Rule not working based on Schedule Start-Time

Venki
2012-05-15T16:25:27Z

I am trying to use Ice Cube. It is a great library and intuitive to
use.

I am not sure I am doing it the right way. However, its not working
based on the value.


require ''rubygems''
require ''activesupport/all''
require ''ice_cube''

include IceCube

schedule =
Schedule.new(DateTime.strptime(''2012-01-01T08:00:00+00:00'',
''%Y-%m-%dT%H:%M:%S%z''))
schedule.add_recurrence_rule Rule.daily

startd=DateTime.strptime(''2012-05-16T00:00:00+00:00'',
''%Y-%m-%dT%H:%M:
%S%z'')
endd=DateTime.strptime(''2012-05-20T00:00:00+00:00'',
''%Y-%m-%dT%H:%M:%S
%z'')
schedule.occurrences_between(startd,endd)

Returns empty list at the end.

However, if I create the schedule as follows


schedule =
Schedule.new(DateTime.strptime(''2012-05-17T08:00:00+00:00'',
''%Y-%m-%dT%H:%M:%S%z''))

and rest of the code the same, I get the right occurrences.

What is going wrong?

Also, is there a way to create Schedule from a iCalendar Rule just
like the way to create one from hash/yaml.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at