From rberger at ibd.com Tue Jan 8 04:42:53 2008 From: rberger at ibd.com (Robert J. Berger) Date: Tue, 8 Jan 2008 01:42:53 -0800 Subject: [iCalendar-devel] Status of Timezone support / Handeling DTSTART; TZID="(GMT-05.00) Eastern Time (US & Canada)":20080107T123000 Message-ID: <1407A0C7-C89D-4B54-9987-704DB1FA4EEC@ibd.com> I can not tell from the docs or from the mailing list what is the state of timezone support in the iCalendar package? If I want to parse an iCalendar file that has non utc dstarts and dends will it convert those times to UTC or otherwise allow me to do that? When I tried to parse an iCalendar input file started off with something like this: BEGIN:VCALENDAR METHOD:REQUEST PRODID:Microsoft CDO for Microsoft Exchange VERSION:2.0 BEGIN:VTIMEZONE TZID:(GMT-05.00) Eastern Time (US & Canada) X-MICROSOFT-CDO-TZID:10 BEGIN:STANDARD DTSTART:16010101T020000 TZOFFSETFROM:-0400 TZOFFSETTO:-0500 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU END:STANDARD BEGIN:DAYLIGHT DTSTART:16010101T020000 TZOFFSETFROM:-0500 TZOFFSETTO:-0400 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU END:DAYLIGHT END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20080107T155404Z DTSTART;TZID="(GMT-05.00) Eastern Time (US & Canada)":20080107T123000 I got: event.start.to_s => "2008-01-07T12:30:00+00:00" event.start.zone => "+00:00" Even though the Dstart had a TZID setting it to Eastern Time. (Vpim which I've been using up till now, does the same thing I'm hoping to find a vcalendar library that can work with timezones, thus my question) Is there any easy way to handle vcalendar files that have DSTARTs and DENDs that are in this format and have the event.start ether have the timezone or normalize them properly to utc? Also as a side note, I was following the example in the readme (I'm pretty sure I did all the same requires and includes as the readme) and tried to do: puts "start date-time: " + event.dtstart But got: TypeError: can't convert DateTime into String from (irb):9:in `+' from (irb):9 But event.start worked fine. ?????????????????????????????? Robert J. Berger - Internet Bandwidth Development, LLC. Voice: 408-838-8896 eFax: +1-408-490-2868 http://www.ibd.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/icalendar-devel/attachments/20080108/30c64046/attachment.html From craig at tobyhouse.com Mon Jan 28 18:51:52 2008 From: craig at tobyhouse.com (Craig White) Date: Mon, 28 Jan 2008 16:51:52 -0700 Subject: [iCalendar-devel] newbie - problem parsing the 'status' Message-ID: <1201564312.5887.71.camel@cube.tobyhouse.com> This is what's happening in script/console... require 'icalendar' => [] require 'net/http' => [] cal = 'https://name:passwd at myserver/ics.php?c=5be410ec5238fc93c1f66b1a935365c9' url = URI.parse cal => # req = Net::HTTP::Get.new(url.path) => # res = Net::HTTP.start(url.host, url.port) {|http|http.request(req) } Net::HTTPBadResponse: wrong status line: "" from /usr/lib/ruby/1.8/net/http.rb:2022:in `read_status_line' from /usr/lib/ruby/1.8/net/http.rb:2009:in `read_new' from /usr/lib/ruby/1.8/net/http.rb:1050:in `request' from (irb):13 from /usr/lib/ruby/1.8/net/http.rb:543:in `start' from /usr/lib/ruby/1.8/net/http.rb:440:in `start' from (irb):13 Does this mean that my ical file is improper? I can load this with other programs (iCal, Sunbird, Korganizer, etc.) I'm confused Craig From craig at tobyhouse.com Tue Jan 29 12:08:08 2008 From: craig at tobyhouse.com (Craig White) Date: Tue, 29 Jan 2008 10:08:08 -0700 Subject: [iCalendar-devel] newbie - problem parsing the 'status' In-Reply-To: <1201564312.5887.71.camel@cube.tobyhouse.com> References: <1201564312.5887.71.camel@cube.tobyhouse.com> Message-ID: <1201626488.5887.86.camel@cube.tobyhouse.com> On Mon, 2008-01-28 at 16:51 -0700, Craig White wrote: > This is what's happening in script/console... > > require 'icalendar' > => [] > > require 'net/http' > => [] > > cal = > 'https://name:passwd at myserver/ics.php?c=5be410ec5238fc93c1f66b1a935365c9' > > url = URI.parse cal > => # > > req = Net::HTTP::Get.new(url.path) > => # > > res = Net::HTTP.start(url.host, url.port) {|http|http.request(req) } > Net::HTTPBadResponse: wrong status line: " \"-//IETF//DTD HTML 2.0//EN\">" > from /usr/lib/ruby/1.8/net/http.rb:2022:in `read_status_line' > from /usr/lib/ruby/1.8/net/http.rb:2009:in `read_new' > from /usr/lib/ruby/1.8/net/http.rb:1050:in `request' > from (irb):13 > from /usr/lib/ruby/1.8/net/http.rb:543:in `start' > from /usr/lib/ruby/1.8/net/http.rb:440:in `start' > from (irb):13 > > Does this mean that my ical file is improper? > > I can load this with other programs (iCal, Sunbird, Korganizer, etc.) > > I'm confused ---- OK, I think the file might be acceptable but apparently net/http is stumbling on my self-signed certificates which by my read of ruby's net/http, there's no mechanism to deal with a self-signed certificate. Anyone with clues would be appreciated Craig From craig at tobyhouse.com Tue Jan 29 17:32:26 2008 From: craig at tobyhouse.com (Craig White) Date: Tue, 29 Jan 2008 15:32:26 -0700 Subject: [iCalendar-devel] I need someone to toss me a bone here Message-ID: <1201645946.5887.115.camel@cube.tobyhouse.com> finally got through all the issues of using self-signed certs and now have my iCal file in hand. Now I need a procedure to parse without tossing errors for unknown methods and it should be simple but it escapes me (Rails dummy here)... Obviously I need a way to live with attributes that aren't part of the standard definition. I presume that I need to extend the Icalendar class in some manner... >> cals=Icalendar.parse(result) NoMethodError: Method Name: aalarm from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/component.rb:413:in `method_missing' from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/parser.rb:179:in `send' from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/parser.rb:179:in `parse_component' from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/parser.rb:131:in `parse_component' from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/parser.rb:101:in `parse' from /usr/lib/ruby/gems/1.8/gems/icalendar-1.0.2/lib/icalendar/parser.rb:16:in `parse' from (irb):113 >> cals[0] NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[] from (irb):114 Bones? Craig