concerto / concerto-calendar

calendar content type from google, iCal, *Bedework, *CalDav (*WIP)
Other
5 stars 7 forks source link

ical dates showing in UTC instead of local time zone #9

Open mfrederickson opened 10 years ago

mfrederickson commented 10 years ago

Someone in the group wrote:

I'm working with concerto 2.0 for the first time and I've run into a time zone problem. The server clock is correct the the screen shows the correct time and date. My problem is that I want to add a google calendar option. I created the calendar and made it public. I copied the ICAL address and added the calendar to concerto. Everything looks fine except for the times. I set an event for 10:00am - 10:30am and it's showing 3:00pm - 3:30pm. It would appear that it's looking at my calendar and adjusting it upto UTC time..

I tried looking at an event scheduled for 12:55pm and found it came back in UTC also. Looks like we might need to add the in_time_zone(Time.zone) in the model to get it to display properly...

2.1.0 :036 > e.dtstart.to_time
 => Wed, 17 Sep 2014 20:55:00 +0000 
2.1.0 :037 > Time.zone
 => #<ActiveSupport::TimeZone:0x00000007119318 @name="Alaska", @utc_offset=nil, @tzinfo=#<TZInfo::TimezoneProxy: America/Juneau>, @current_period=nil> 
2.1.0 :038 > e.dtstart.to_time.in_time_zone(Time.zone).strftime("%l:%M %P")
 => "12:55 pm" 
carsifreifunk commented 6 years ago

Is there a workaround for this bug? I get this issue in my content. In all settings I set UTC+1 (Europe/Berlin) and in the client is UTC shown.

ajones6 commented 6 years ago

If I try to use a Google Calendar using the iCal method, the times are not correct. The Google API method seems broken, so I have to use the iCal method.