Hello, I''m using ruby and icalendar to export my Groupwise calendar so I can view it in Google Calendar (using some code I modified from this: http://timshadel.com/code/tidbits/gw2ical.rb ) but I have an issue with all-day events. As created via this ruby script, an all-day event starts at midnight on the first day and ends at midnight on the next day, like this: DTSTART:20070702T000000 DTEND:20070703T000000 Which unfortunately shows on Google Calendar as starting at midnight and ending at midnight, rather than as an all-day event. On a "real" Google Calendar, if I view the basic.ics file, an all day event shows like this: DTSTART;VALUE=DATE:20070619 DTEND;VALUE=DATE:20070620 I can''t figure out if there''s a way to get icalendar to write an all-day event in this format, so it will show up correctly in Google Calendar. Am I missing something? Thanks much! Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/icalendar-devel/attachments/20070625/3cffb4fe/attachment.html
Hi Adam, The only way I could get this to work was to store it as a date: "20070702" without the "T000000". I am not sure if that is the correct way. I also noticed that sometimes the Ruby iCalendar library will convert this back to a DateTime string (with the T000000) so you have to be careful of that... I hope that helps in some regard. -John Postlethwait On 6/25/07, Adam Howard <AHoward at nocccd.edu> wrote:> > Hello, > > I''m using ruby and icalendar to export my Groupwise calendar so I can view > it in Google Calendar (using some code I modified from this: > http://timshadel.com/code/tidbits/gw2ical.rb ) but I have an issue with > all-day events. > > As created via this ruby script, an all-day event starts at midnight on > the first day and ends at midnight on the next day, like this: > DTSTART:20070702T000000 > DTEND:20070703T000000 > Which unfortunately shows on Google Calendar as starting at midnight and > ending at midnight, rather than as an all-day event. On a "real" Google > Calendar, if I view the basic.ics file, an all day event shows like this: > DTSTART;VALUE=DATE:20070619 > DTEND;VALUE=DATE:20070620 > I can''t figure out if there''s a way to get icalendar to write an all-day > event in this format, so it will show up correctly in Google Calendar. Am I > missing something? > > Thanks much! > > Adam > > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/icalendar-devel/attachments/20070625/855ccdd8/attachment.html
Sorry Adam, I left out some details...
Here is what I used to do it:
event = Icalendar::Event.new
event.dtstart Date.parse( dtstart.to_s ), {"VALUE" =>
["DATE"]}
This will give you the: DTEND;VALUE=DATE:20070620 string you desire.
-John Postlethwait
On 6/25/07, John Postlethwait <john at myquire.com>
wrote:>
> Hi Adam,
>
> The only way I could get this to work was to store it as a date:
> "20070702" without the "T000000". I am not sure if that
is the correct way.
> I also noticed that sometimes the Ruby iCalendar library will convert this
> back to a DateTime string (with the T000000) so you have to be careful of
> that...
>
> I hope that helps in some regard.
>
> -John Postlethwait
>
> On 6/25/07, Adam Howard <AHoward at nocccd.edu > wrote:
>
> > Hello,
> >
> > I''m using ruby and icalendar to export my Groupwise calendar
so I can
> > view it in Google Calendar (using some code I modified from this:
> > http://timshadel.com/code/tidbits/gw2ical.rb ) but I have an issue
with
> > all-day events.
> >
> > As created via this ruby script, an all-day event starts at midnight
on
> > the first day and ends at midnight on the next day, like this:
> > DTSTART:20070702T000000
> > DTEND:20070703T000000
> > Which unfortunately shows on Google Calendar as starting at midnight
and
> > ending at midnight, rather than as an all-day event. On a
"real" Google
> > Calendar, if I view the basic.ics file, an all day event shows like
> > this:
> > DTSTART;VALUE=DATE:20070619
> > DTEND;VALUE=DATE:20070620
> > I can''t figure out if there''s a way to get icalendar
to write an all-day
> > event in this format, so it will show up correctly in Google Calendar.
Am I
> > missing something?
> >
> > Thanks much!
> >
> > Adam
> >
> >
> > _______________________________________________
> > icalendar-devel mailing list
> > icalendar-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/icalendar-devel
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/icalendar-devel/attachments/20070625/ab7c16e1/attachment.html