ice-cube-ruby / ice_cube

Ruby Date Recurrence Library - Allows easy creation of recurrence rules and fast querying
MIT License
2.37k stars 358 forks source link

Schedule losing timezone when serialized with ical #439

Open Rockster160 opened 6 years ago

Rockster160 commented 6 years ago

Ruby 2.3.1 Rails 5.0.2 IceCube 0.16.2

schedule = IceCube::Schedule.new(Time.now.in_time_zone(-6))
=> #<IceCube::Schedule:0x005592aed59940 @start_time=Fri, 23 Mar 2018 19:53:42 CST -06:00, @all_recurrence_rules=[], @all_exception_rules=[]>
> schedule.start_time
=> Fri, 23 Mar 2018 19:53:42 CST -06:00
> IceCube::Schedule.from_ical(schedule.to_ical).start_time
=> 2018-03-23 19:53:42 +0000

Notice it goes from 7:53 PM CST to 7:53 PM UTC - losing the accuracy of the time as well as dropping the time zone.

hbhanoo commented 3 years ago

I just noticed this too!