add_to_calendar_links 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/add_to_calendar_links.rb +4 -5
- data/lib/add_to_calendar_links/version.rb +1 -1
- 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: 2497b47a154707baecaf96e5a06c8bf247a3a4927bac368fe9102d64ab53c139
|
4
|
+
data.tar.gz: 03d063b6c2083d55d09e7ba710616d5de6337dbf8ba4f0e16c133147ea190607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 045fb5416365467b8b557c981d27a754826750a0efce2d2dbc00ab348b5bdba7e4e37449611fdc828772be5c13bd639b8f78d045ac937f14981345c0d589d9e4
|
7
|
+
data.tar.gz: c64b76d1d4fa90e10c3e0227e413064330b9adbcf2d0e38a09360a110310fef2a85ae015ff0d723a1e79dae63fd8cb8374d43167db490fa783204e0941ee3386
|
@@ -100,7 +100,7 @@ module AddToCalendarLinks
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def ical_file
|
103
|
-
calendar_url = "BEGIN:VCALENDAR\nVERSION:2.0\nBEGIN:VEVENT"
|
103
|
+
calendar_url = "BEGIN:VCALENDAR\nVERSION:2.0\nMETHOD:REQUEST\nBEGIN:VEVENT"
|
104
104
|
|
105
105
|
params = {}
|
106
106
|
params[:DTSTART] = utc_datetime(start_datetime)
|
@@ -124,7 +124,7 @@ module AddToCalendarLinks
|
|
124
124
|
params[:UID] = "-#{utc_datetime(start_datetime)}-#{title}" unless params[:UID] # set uid based on starttime and title only if url is unavailable
|
125
125
|
params[:ORGANIZER] = organizer if organizer
|
126
126
|
params[:SEQUENCE] = sequence if sequence
|
127
|
-
params[
|
127
|
+
params["LAST-MODIFIED"] = format_date_google(last_modified) if last_modified
|
128
128
|
params[:METHOD] = "REQUEST"
|
129
129
|
|
130
130
|
params.each do |key, value|
|
@@ -139,7 +139,7 @@ module AddToCalendarLinks
|
|
139
139
|
def ical_url
|
140
140
|
# Downloads a *.ics file provided as a data-uri
|
141
141
|
# Eg. "data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:20200512T123000Z%0ADTEND:20200512T160000Z%0ASUMMARY:Holly%27s%208th%20Birthday%21%0AURL:https%3A%2F%2Fwww.example.com%2Fevent-details%0ADESCRIPTION:Come%20join%20us%20for%20lots%20of%20fun%20%26%20cake%21\\n\\nhttps%3A%2F%2Fwww.example.com%2Fevent-details%0ALOCATION:Flat%204%5C%2C%20The%20Edge%5C%2C%2038%20Smith-Dorrien%20St%5C%2C%20London%5C%2C%20N1%207GU%0AUID:-https%3A%2F%2Fwww.example.com%2Fevent-details%0AEND:VEVENT%0AEND:VCALENDAR"
|
142
|
-
calendar_url = "data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT"
|
142
|
+
calendar_url = "data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0AMETHOD:REQUEST%0ABEGIN:VEVENT"
|
143
143
|
|
144
144
|
params = {}
|
145
145
|
params[:DTSTART] = utc_datetime(start_datetime)
|
@@ -163,8 +163,7 @@ module AddToCalendarLinks
|
|
163
163
|
params[:UID] = "-#{utc_datetime(start_datetime)}-#{url_encode_ical(title)}" unless params[:UID] # set uid based on starttime and title only if url is unavailable
|
164
164
|
params[:ORGANIZER] = organizer if organizer
|
165
165
|
params[:SEQUENCE] = sequence if sequence
|
166
|
-
params[
|
167
|
-
params[:METHOD] = "REQUEST"
|
166
|
+
params["LAST-MODIFIED"] = format_date_google(last_modified) if last_modified
|
168
167
|
|
169
168
|
new_line = "%0A"
|
170
169
|
params.each do |key, value|
|