Last active
December 20, 2015 15:09
-
-
Save hoffmanc/6152405 to your computer and use it in GitHub Desktop.
Revisions
-
hoffmanc revised this gist
Aug 5, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ @appointments.each_with_index do |appt, idx| out << <<CAL BEGIN:VEVENT DTSTART:#{l(appt.starts_at, format: :ical)} DTEND:#{l(appt.ends_at, format: :ical)} DTSTAMP:#{l(Time.now, format: :ical)} UID:appointment#{appt.id}@#{request.host} CREATED:#{l(appt.created_at, format: :ical)} -
hoffmanc revised this gist
Aug 4, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,4 @@ en: time: formats: ical: "%Y%m%dT%H%M%SZ" -
hoffmanc revised this gist
Aug 4, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # locales/en.yml en: time: formats: ical: "%Y%m%dT%H%MZ" -
hoffmanc created this gist
Aug 4, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # config/initializers/ics.rb ActionView::Template.register_template_handler(:rb, :source.to_proc) Mime::Type.register_alias "text/calendar", :ics This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ out = <<CAL BEGIN:VCALENDAR PRODID:-//I CAN HAZ COMPANY?//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:PUBLISH CAL @appointments.each_with_index do |appt, idx| out << <<CAL BEGIN:VEVENT DTSTART;VALUE=#{l(appt.starts_at, format: :ical)} DTEND;VALUE=#{l(appt.ends_at, format: :ical)} DTSTAMP:#{l(Time.now, format: :ical)} UID:appointment#{appt.id}@#{request.host} CREATED:#{l(appt.created_at, format: :ical)} DESCRIPTION:#{appt.reason} LAST-MODIFIED:#{l(appt.updated_at, format: :ical)} LOCATION: SEQUENCE:#{idx} STATUS:#{appt.status_ical} SUMMARY:#{appt.reason} END:VEVENT CAL end out << "END:VCALENDAR" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #... def index format.ics end #...