File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -89,17 +89,20 @@ def schedule
8989 @proposals = @event . proposals . scheduled . located
9090 respond_to do |format |
9191 format . ics {
92- c = Icalendar :: Calendar . new
92+ c = Vpim :: Icalendar . create2
9393 @proposals . each do |session |
94- c . event do
95- summary session . title
96- description session . excerpt
97- location session . room . name
98- start session . start_time . to_datetime
99- duration session . duration
94+ c . add_event do |event |
95+ event . dtstart session . start_time
96+ event . dtend session . start_time + session . duration . minutes
97+ event . summary session . title
98+ event . created session . created_at if session . created_at
99+ event . lastmod session . updated_at if session . updated_at
100+ event . description session . excerpt
101+ event . url url_for session
102+ event . set_text 'LOCATION' , session . room . name
100103 end
101104 end
102- render :text => c . to_ical
105+ render :text => c . encode . sub ( /CALSCALE:Gregorian/ , "CALSCALE:Gregorian \n X-WR-CALNAME: #{ @event . title } \n METHOD:PUBLISH" )
103106 }
104107 end
105108 end
Original file line number Diff line number Diff line change 3131 config . gem "thoughtbot-paperclip" , :source => "http://gems.github.com" , :lib => 'paperclip'
3232 config . gem "rubyist-aasm" , :source => "http://gems.github.com" , :lib => 'aasm'
3333 config . gem "gchartrb" , :lib => "google_chart"
34- config . gem "sdague-icalendar " , :lib => 'icalendar' , :source => "http://gems.github.com"
34+ config . gem "vpim " , :lib => 'vpim/ icalendar'
3535 config . gem "RedCloth"
3636
3737 # Settings in config/environments/* take precedence over those specified here.
You can’t perform that action at this time.
0 commit comments