Created
January 11, 2012 08:38
-
-
Save daicham/1593740 to your computer and use it in GitHub Desktop.
iCalendar by ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'icalendar' | |
require 'date' | |
cal = Icalendar::Calendar.new | |
cal.event do | |
dtstart DateTime.new(2010, 05, 19, 22, 00), {'TZID' => 'Asis/Tokyo'} | |
dtend DateTime.new(2010, 05, 19, 22, 30), {'TZID' => 'Asis/Tokyo'} | |
summary "うちあわせ" | |
end | |
cal.event do | |
dtstart DateTime.new(2010, 05, 20, 22, 00), {'TZID' => 'Asis/Tokyo'} | |
dtend DateTime.new(2010, 05, 20, 22, 30), {'TZID' => 'Asis/Tokyo'} | |
summary "うちあわせ2" | |
end | |
cal.timezone do | |
tzid "Asia/Tokyo" | |
standard do | |
tzoffsetfrom "+0900" | |
tzoffsetto "+0900" | |
end | |
end | |
cal.publish | |
puts cal.to_ical |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment