active-icalendar-events 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d892e9c6fe0c2ed7de91e9f085aa7e812901b6ddce53184928d6be5482a2a3b
4
- data.tar.gz: 3ab320fe7a381d9361a50a629eeafdcae8e581b7695cdbc514b140e77fb11171
3
+ metadata.gz: 981c99140882554d70998f2b1225ce89cb47b80fb7471172c62c215204aecdb5
4
+ data.tar.gz: 5d58a68cb6195024aedb6a0d461c8c03a98a1f88ad5d4c0f0250e4fe08e5d077
5
5
  SHA512:
6
- metadata.gz: 8a702e4fdec5d0474469d5445ab6eb218a54cebfce69d40872c7c75e5a3328666e1e6e917e6073ea379effc52bc6fc660c662e09442f332d1cf955997b23d3d8
7
- data.tar.gz: 5956bb66a7955f25126cd861fb77e0386d8ee2cd073c7d36468007a4879185b4b0b8ce9599f2dbc62e87516bdbb2263e36ed706c68afc397c5a2145757bd11ce
6
+ metadata.gz: 426bb70b73ab75023013c15040498a1fc69605c5c39f08d06a83457e8e29467074064c7058083dd7223d4afad2be5a3d5c281d8a289b79d36560eff124b57ad4
7
+ data.tar.gz: be2600c740997701ffeab23b6eb51e844cefe31912f8c7baa9b383501a4505e50381e52c0fa844be76aad25ca2591403770999809ff0e7d0f88974f15b435083
@@ -92,10 +92,22 @@ module ActiveIcalendarEvents
92
92
 
93
93
  def format_icalendar_data(icalendar_data)
94
94
  icalendar_data.first.events.map { |e|
95
+ event_start = e.dtstart
96
+ if event_start.is_a?(Icalendar::Values::Date)
97
+ timezone = ActiveSupport::TimeZone.new(e.parent.timezones.first.tzid.to_s)
98
+ event_start = timezone.local(event_start.year, event_start.month, event_start.day)
99
+ end
100
+
101
+ event_end = e.dtend
102
+ if event_end.is_a?(Icalendar::Values::Date)
103
+ timezone = ActiveSupport::TimeZone.new(e.parent.timezones.first.tzid.to_s)
104
+ event_end = timezone.local(event_end.year, event_end.month, event_end.day)
105
+ end
106
+
95
107
  {
96
108
  name: e.summary,
97
- event_start: e.dtstart,
98
- event_end: e.dtend,
109
+ event_start: event_start,
110
+ event_end: event_end,
99
111
  recurrence_rule: e.rrule,
100
112
  recurrence_dates: e.rdate,
101
113
  excluding_dates: e.exdate,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-icalendar-events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Starling