seejohnrun/ice_cube — Issue #61: Can't set start_date for Schedule
Author: tommyblue
Created: 2012-01-29 17:23:32+00:00
State: open

I'm trying to use ice_cube with rails but I think there are some bugs with start_date.
See this code:

```ruby
> tmp.class
=> IceCube::Schedule
> tmp
=> Monthly on the 1st day of the month
> tmp.start_date = Date.parse('2012-05-01')
=> Tue, 01 May 2012
> tmp.start_date
=> Tue, 01 May 2012
> tmp.to_hash
=> {:start_date=>nil, :rrules=>[{:validations=>{:day_of_month=>[1]}, :rule_type=>"IceCube::MonthlyRule", :interval=>1}], :exrules=>[], :rdates=>[], :exdates=>[]}
>
>
> tmp.start_date = DateTime.civil(2012,05,11)
=> Fri, 11 May 2012 00:00:00 +0000
> tmp.start_time
=> Fri, 11 May 2012 00:00:00 +0000
> tmp.to_hash
=> {:start_date=>nil, :rrules=>[{:validations=>{:day_of_month=>[1]}, :rule_type=>"IceCube::MonthlyRule", :interval=>1}], :exrules=>[], :rdates=>[], :exdates=>[]}
>
>
> tmp.start_date = Time.now
=> 2012-01-29 18:18:53 +0100
> tmp.start_time
=> 2012-01-29 18:18:53 +0100
> tmp.to_hash
=> {:start_date=>2012-01-29 18:18:53 +0100, :rrules=>[{:validations=>{:day_of_month=>[1]}, :rule_type=>"IceCube::MonthlyRule", :interval=>1}], :exrules=>[], :rdates=>[], :exdates=>[]}
```

It seems to understand only DateTime and only with a specific format, but I can't understand which. I'm trying to set start_date from a form only setting the date (not time) but I'm not able to save this attribute...