Hello I am trying to set the timezone on event level when writing out in icalendar format. I saw that there was some discussion in january 2006 about this issue, but I could not figure out what the correct syntax is. Does it go on the Calendar event entry level or does each calendar event have to be of the same timezone I would be gratefull if a piece of code that works would be sent to show how the passing of timezones is realized. a) @cal=icalendar::new :timezone =>"Europe/Copenhagen b) event.start = Date.Now :timezone =>"Europe/Copenhagen I would prefer a solution with option b) Thanx Roland -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
Well, I think you just about got it. The calendar_test.rb unit test has an example of this, which goes like so inside an event definition: event.dtend "19970903T190000Z", {:TZID => "Europe/Copenhagen"} That will set the timezone property parameter for that single property. Hope this helps. Cheers, Jeff Roland Oth wrote:> Hello > I am trying to set the timezone on event level when writing out in icalendar format. I saw that there was some discussion in january 2006 about this issue, but I could not figure out what the correct syntax is. > Does it go on the Calendar event entry level or does each calendar event have to be of the same timezone > > I would be gratefull if a piece of code that works would be sent to show > how the passing of timezones is realized. > > a) @cal=icalendar::new :timezone =>"Europe/Copenhagen > b) event.start = Date.Now :timezone =>"Europe/Copenhagen > > I would prefer a solution with option b) > > Thanx Roland
Hello Jeff, I integrated as shown with 2 differentt trials #event.end = ende.strftime("%Y%m%dT%H%M%SZ"), {:TZID => "Europe/Copenhagen"} event.dtend = "20060917T19300Z", {:TZID => "Europe/Copenhagen"} .. and got this error response : "undefined method `to_ical'' for {:TZID=>"Europe/Copenhagen"}:Hash" Here is some Version Information: /usr/lib/ruby/gems/1.8/gems/icalendar-0.97/ Any clues? I tried to debug with breakpoint. There I managed to passe the parameters but once I tried to render the calendar with to_ical I got the same error. Thanx Roland --------- Datum: Fri, 15 Sep 2006 10:44:28 +0200 Von: Jeff Rose <jeff at rosejn.net> An: "iCalendar developers & users" <icalendar-devel at rubyforge.org> Betreff: Re: [iCalendar-devel] icalendar timezones> Well, I think you just about got it. The calendar_test.rb unit test has > an example of this, which goes like so inside an event definition: > > event.dtend "19970903T190000Z", {:TZID => "Europe/Copenhagen"} > > That will set the timezone property parameter for that single property. > Hope this helps. > > Cheers, > Jeff-- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
On 15/09/2006, at 14.16, Roland Oth wrote:> Hello Jeff, > I integrated as shown with 2 differentt trials > #event.end = ende.strftime("%Y%m%dT%H%M%SZ"), {:TZID => "Europe/ > Copenhagen"} > event.dtend = "20060917T19300Z", {:TZID => "Europe/Copenhagen"} > .. and got this error response : > "undefined method `to_ical'' for {:TZID=>"Europe/Copenhagen"}:Hash" > > Here is some Version Information: > /usr/lib/ruby/gems/1.8/gems/icalendar-0.97/ > Any clues? > I tried to debug with breakpoint. There I managed to passe the > parameters but once I tried to render the calendar with to_ical I > got the > same error.Any news on this bug? I have the exact same problem - I really don''t get how to set the timezone for my calendar or the events. Greetings, Gitte Wange
Hello Gitte Your Syntax event.end = ende.strftime("%Y%m%dT%H%M%SZ"), {:TZID => "Europe/ Copenhagen"} looks ok. Did you ensure that require ''icalendar'' require ''date'' is in your controller? roland
On 06/12/2006, at 7.49, roland wrote:> Hello Gitte > Your Syntax > event.end = ende.strftime("%Y%m%dT%H%M%SZ"), {:TZID => "Europe/ > Copenhagen"} > looks ok. > > Did you ensure that > require ''icalendar'' > require ''date'' > > is in your controller?Do I need to require the date module? I can easily create Date objects without the require Greetings, Gitte
I am not sure. My controller has these require lines ( I assume I read it in some blog).. In anycase, it works for me. roland Am 06.12.2006 um 09:34 schrieb Gitte Wange:> > On 06/12/2006, at 7.49, roland wrote: > >> Hello Gitte >> Your Syntax >> event.end = ende.strftime("%Y%m%dT%H%M%SZ"), {:TZID => "Europe/ >> Copenhagen"} >> looks ok. >> >> Did you ensure that >> require ''icalendar'' >> require ''date'' >> >> is in your controller? > > Do I need to require the date module? > I can easily create Date objects without the require > > Greetings, > Gitte > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel