Skip to content

Commit

Permalink
Fixed Proposal#to_icalendar to skip items with nil a start time and n…
Browse files Browse the repository at this point in the history
…ot include the end time for those without a duration.
  • Loading branch information
igal committed May 29, 2010
1 parent a372ca4 commit cb4d0d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/proposal.rb
Expand Up @@ -425,9 +425,10 @@ def self.to_icalendar(items, opts={})
calendar.title = title
calendar.time_zone = Time.zone.tzinfo.name
items.each do |item|
next if item.start_time.nil?
calendar.add_event do |e|
e.dtstart item.start_time
e.dtend item.start_time + item.duration.minutes
e.dtend item.start_time + item.duration.minutes if item.duration
e.summary item.title
e.created item.created_at if item.created_at
e.lastmod item.updated_at if item.updated_at
Expand Down

0 comments on commit cb4d0d4

Please sign in to comment.