Skip to content

Instantly share code, notes, and snippets.

@daicham
Created January 11, 2012 08:38
Show Gist options
  • Save daicham/1593740 to your computer and use it in GitHub Desktop.
Save daicham/1593740 to your computer and use it in GitHub Desktop.
iCalendar by ruby
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