Skip to content

Commit

Permalink
Add Apple structured location to iCal
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescmartinez committed Dec 28, 2017
1 parent c4612bf commit 8331759
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/services/group_calendar_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def to_ical
calendar_event.dtstart = Icalendar::Values::DateOrDateTime.new(event.start_at, tzid: event.start_at.zone).call
calendar_event.dtend = Icalendar::Values::DateOrDateTime.new(event.end_at, tzid: event.end_at.zone).call
calendar_event.location = event.location
calendar_event.append_custom_property('X-APPLE-STRUCTURED-LOCATION', event.location)
calendar.add_event(calendar_event)
end

Expand Down
1 change: 1 addition & 0 deletions spec/services/group_calendar_creator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
expect(calendar_event.dtend).to eq(last_event.end_at.change(usec: 0))
expect(calendar_event.dtend.to_s).to include('UTC')
expect(calendar_event.location).to eq('Sightglass Coffee')
expect(calendar_event.x_apple_structured_location.first).to eq('Sightglass Coffee')
end
end
end

0 comments on commit 8331759

Please sign in to comment.