123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <dialog id="calendar" class="modal">
- <div class="modal-box w-11/12 max-w-5xl">
- <h3 class="text-lg font-bold">Kalendar</h3>
- <div class="flex items-center justify-center py-8 px-4">
- <div class="max-w-sm w-full shadow-lg">
- <div class="md:p-8 p-5 bg-babyblue rounded-t">
- <div class="flex items-center justify-center">
- <span tabindex="0" class="focus:outline-none text-base font-bold text-gray-800">August 2024</span>
- </div>
- <div class="flex items-center justify-between pt-12 overflow-x-auto">
- <table class="w-full">
- <thead>
- <tr>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Mo</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Tu</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">We</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Th</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Fr</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Sa</p>
- </div>
- </th>
- <th>
- <div class="w-full flex justify-center">
- <p class="text-base font-medium text-center text-gray-800">Su</p>
- </div>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center"></div>
- </td>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center"></div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center"></div>
- </td>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">1</p>
- </div>
- </td>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">2</p>
- </div>
- </td>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">3</p>
- </div>
- </td>
- <td class="pt-6">
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">4</p>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">5</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">6</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">7</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">8</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">9</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">10</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">11</p>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">12</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">13</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">14</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">15</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">16</p>
- </div>
- </td>
- <td>
- <div class="w-full h-full">
- <div class="flex items-center justify-center w-full rounded-full cursor-pointer">
- <a role="link" tabindex="0" class="focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-700 focus:bg-indigo-500 hover:bg-indigo-500 text-base w-8 h-8 flex items-center justify-center font-medium text-white bg-indigo-700 rounded-full">17</a>
- </div>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">18</p>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">19</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">20</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">21</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">22</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">23</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">24</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">25</p>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">26</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">27</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">28</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">29</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500 font-medium">30</p>
- </div>
- </td>
- <td>
- <div class="px-2 py-2 cursor-pointer flex w-full justify-center">
- <p class="text-base text-gray-500">31</p>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-action">
- <form method="dialog" id="closeCalendarForm"></form>
- <button type="button" class="btn bg-babybluedark" id="saveDate">Simpan</button>
- <button type="button" class="btn" id="submitCloseCalendarForm">Tutup</button>
- </div>
- </div>
- </dialog>
-
- @push('script')
- <script>
- $(document).ready(function() {
- $('#submitCloseCalendarForm').click(function(e) {
- $('#closeCalendarForm').submit();
- });
- });
- </script>
-
- <script>
- function getMobileOperatingSystem() {
- var userAgent = navigator.userAgent || navigator.vendor || window.opera;
-
- if (/windows phone/i.test(userAgent)) {
- return "Windows Phone";
- }
-
- if (/android/i.test(userAgent)) {
- return "Android";
- }
-
- if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
- return "iOS";
- }
-
- return "unknown";
- }
-
- document.getElementById('saveDate').addEventListener('click', function () {
- const os = getMobileOperatingSystem();
- console.log("Operating System: " + os);
-
- const title = 'Majlis Perkahwinan Aliff & Ayuna';
- const startDate = '20240817T110000';
- const endDate = '20240817T160000';
- const details = 'Majlis Resepsi Perkawinan Aliff & Ayuna';
- const location = 'Dewan Jubli Perak Sultan Haji Ahmad Shah, Jalan Teluk Sisek, Kuantan, Pahang';
-
- if (os === 'iOS') {
- const icsContent = `BEGIN:VCALENDAR
- VERSION:2.0
- BEGIN:VEVENT
- SUMMARY:${title}
- DTSTART:${startDate}
- DTEND:${endDate}
- DESCRIPTION:${details}
- LOCATION:${location}
- END:VEVENT
- END:VCALENDAR`;
-
- const dataURI = 'data:text/calendar;charset=utf-8,' + encodeURIComponent(icsContent);
- const a = document.createElement('a');
- a.href = dataURI;
- a.download = 'event.ics';
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- } else if (os === 'Android') {
- const googleCalendarUrl = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(title)}&dates=${startDate}/${endDate}&details=${encodeURIComponent(details)}&location=${encodeURIComponent(location)}`;
- window.open(googleCalendarUrl, '_blank');
- } else {
- alert('Your device is not supported for this feature.');
- }
- });
-
- </script>
- @endpush
|