Skip to content

Instantly share code, notes, and snippets.

@daicham daicham/gist:1593740
Created Jan 11, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.