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

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.