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 +4 -4
- data/lib/active-icalendar-events.rb +14 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 981c99140882554d70998f2b1225ce89cb47b80fb7471172c62c215204aecdb5
|
4
|
+
data.tar.gz: 5d58a68cb6195024aedb6a0d461c8c03a98a1f88ad5d4c0f0250e4fe08e5d077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
98
|
-
event_end:
|
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,
|