|
@@ -279,25 +279,23 @@
|
279
|
279
|
|
280
|
280
|
if (os === 'iOS') {
|
281
|
281
|
const icsContent = `BEGIN:VCALENDAR
|
282
|
|
- VERSION:2.0
|
283
|
|
- BEGIN:VEVENT
|
284
|
|
- SUMMARY:${title}
|
285
|
|
- DTSTART:${startDate}
|
286
|
|
- DTEND:${endDate}
|
287
|
|
- DESCRIPTION:${details}
|
288
|
|
- LOCATION:${location}
|
289
|
|
- END:VEVENT
|
290
|
|
- END:VCALENDAR`;
|
|
282
|
+VERSION:2.0
|
|
283
|
+BEGIN:VEVENT
|
|
284
|
+SUMMARY:${title}
|
|
285
|
+DTSTART:${startDate}
|
|
286
|
+DTEND:${endDate}
|
|
287
|
+DESCRIPTION:${details}
|
|
288
|
+LOCATION:${location}
|
|
289
|
+END:VEVENT
|
|
290
|
+END:VCALENDAR`;
|
291
|
291
|
|
292
|
|
- const blob = new Blob([icsContent], { type: 'text/calendar' });
|
293
|
|
- const url = URL.createObjectURL(blob);
|
|
292
|
+ const dataURI = 'data:text/calendar;charset=utf-8,' + encodeURIComponent(icsContent);
|
294
|
293
|
const a = document.createElement('a');
|
295
|
|
- a.href = url;
|
|
294
|
+ a.href = dataURI;
|
296
|
295
|
a.download = 'event.ics';
|
297
|
296
|
document.body.appendChild(a);
|
298
|
297
|
a.click();
|
299
|
298
|
document.body.removeChild(a);
|
300
|
|
- URL.revokeObjectURL(url);
|
301
|
299
|
} else if (os === 'Android') {
|
302
|
300
|
const googleCalendarUrl = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(title)}&dates=${startDate}/${endDate}&details=${encodeURIComponent(details)}&location=${encodeURIComponent(location)}`;
|
303
|
301
|
window.open(googleCalendarUrl, '_blank');
|
|
@@ -305,5 +303,6 @@
|
305
|
303
|
alert('Your device is not supported for this feature.');
|
306
|
304
|
}
|
307
|
305
|
});
|
|
306
|
+
|
308
|
307
|
</script>
|
309
|
308
|
@endpush
|