Browse Source

calendar save the date

am
farhan 4 months ago
parent
commit
ce3e7dda97
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      resources/views/modals/calendar-modal.blade.php

+ 3
- 4
resources/views/modals/calendar-modal.blade.php View File

289
                                 END:VEVENT
289
                                 END:VEVENT
290
                                 END:VCALENDAR`;
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
             const a = document.createElement('a');
293
             const a = document.createElement('a');
295
-            a.href = url;
294
+            a.href = dataURI;
296
             a.download = 'event.ics';
295
             a.download = 'event.ics';
297
             document.body.appendChild(a);
296
             document.body.appendChild(a);
298
             a.click();
297
             a.click();
299
             document.body.removeChild(a);
298
             document.body.removeChild(a);
300
-            URL.revokeObjectURL(url);
301
         } else if (os === 'Android') {
299
         } else if (os === 'Android') {
302
             const googleCalendarUrl = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(title)}&dates=${startDate}/${endDate}&details=${encodeURIComponent(details)}&location=${encodeURIComponent(location)}`;
300
             const googleCalendarUrl = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(title)}&dates=${startDate}/${endDate}&details=${encodeURIComponent(details)}&location=${encodeURIComponent(location)}`;
303
             window.open(googleCalendarUrl, '_blank');
301
             window.open(googleCalendarUrl, '_blank');
305
             alert('Your device is not supported for this feature.');
303
             alert('Your device is not supported for this feature.');
306
         }
304
         }
307
     });
305
     });
306
+
308
 </script>
307
 </script>
309
   @endpush
308
   @endpush

Loading…
Cancel
Save