{"id":9817,"date":"2023-06-20T14:24:37","date_gmt":"2023-06-20T14:24:37","guid":{"rendered":"https:\/\/www.makemydayapp.com\/?page_id=9817"},"modified":"2024-01-07T22:02:48","modified_gmt":"2024-01-07T22:02:48","slug":"events-scheduler","status":"publish","type":"page","link":"https:\/\/www.makemydayapp.com\/de\/events-scheduler\/","title":{"rendered":"Terminplaner"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"9817\" class=\"elementor elementor-9817\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5f3504d7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5f3504d7\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6d5de7d1\" data-id=\"6d5de7d1\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a25ab9c elementor-widget elementor-widget-heading\" data-id=\"a25ab9c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\"><span> Herzlich willkommen bei Make My Day - dem Terminplaner f\u00fcr die Automobil- und EV-Branche! Vereinfachen Sie Ihre Veranstaltungsplanung und -organisation mit unserem leistungsstarken Planungstool. Wir haben eine umfassende Sammlung der wichtigsten Veranstaltungen und Konferenzen der Branche zusammengestellt - alles an einem Ort, um Ihnen einen reibungslosen und problemlosen Ablauf zu erm\u00f6glichen.<\/span><\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-603fbfa elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"603fbfa\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3581bd7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3581bd7\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-44a45d5\" data-id=\"44a45d5\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-265b07b elementor-widget-mobile__width-initial c-text-container elementor-widget elementor-widget-html\" data-id=\"265b07b\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div id=\"event-list\"><\/div>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/ical.js@1.4.0\/build\/ical.js\"><\/script>\n<script>\n    let calendarUrl = '\/ical_proxy.php'; \/\/ Get calendar URL\n\n    \/\/ Get the .ics file\n    fetch(calendarUrl)\n          .then((response) => {\n            if (!response.ok) {\n              throw new Error('Error getting the file iCalendar.');\n            }\n            return response.json();\n          })\n        .then((data) => {\n            const jcalData = ICAL.parse(data.ics_data);\n            const comp = new ICAL.Component(jcalData);\n            let events = comp.getAllSubcomponents('vevent');\n\n            \/\/ Filter and process events for the next 3 months\n            const currentDate = new Date();\n            const threeMonthsLater = new Date(currentDate);\n            threeMonthsLater.setMonth(threeMonthsLater.getMonth() + 3);\n\n            events = events.filter((event) => {\n                const startDate = new Date(event.getFirstPropertyValue('dtstart'));\n                return startDate >= currentDate && startDate <= threeMonthsLater;\n            });\n\n            \/\/ Show the events\n            sortEventsByStartDate(events);\n            const eventsByMonth = groupEventsByMonth(events)\n            renderEventList(eventsByMonth);\n        })\n        .catch(function (error) {\n            console.error('Error getting iCalendar file:', error);\n        });\n\n        function renderEventList(eventsByMonth) {\n            let html = '';\n\n            \/\/ Generate HTML per month\n            for (const monthYear in eventsByMonth) {\n                html             += '<h2>' + monthYear + '<\/h2>';\n                const monthEvents = eventsByMonth[monthYear];\n\n                monthEvents.forEach(event => {\n                    const { summary, description, location, startDate } = event;\n                    const startDateFormatted                            = event.startDate.toLocaleString('en', { day: 'numeric', weekday: 'long' });\n                    let timeRange                                       = startDateFormatted;\n\n                    if (event.startDate.getHours() != 0 && event.startDate.getMinutes() != 0 && event.startDate.getSeconds() != 0) {\n                        const startTime = event.startDate.toLocaleString('en', { hour: 'numeric', minute: 'numeric' });\n                        timeRange       = `${startDateFormatted} ${startTime}`;\n                    }\n\n                    html += `<ul style=\"margin-bottom: 10px;\">\n                                <li><strong> ${timeRange} <\/strong>: ${summary}<br>`;\n\n                    if (description !== '') {\n                        html += `<div class=\"c-calendar-content-text\">Description: ${description}<\/div>`;\n                    }\n\n                    if (location !== '') {\n                        html += `<div class=\"c-calendar-content-text\">Location: ${location}<\/div>`;\n                    }\n\n                    html += '<\/li><\/ul>';\n                });\n            html += '<br>';\n            }\n            document.getElementById('event-list').innerHTML = html;\n\n            const accessLink        = document.createElement('button');\n            accessLink.textContent  = 'Request access to the calendar';\n            accessLink.classList.add('c-access-link');\n            accessLink.title        = \"Open calendar to request access\"\n            document.getElementById('event-list').appendChild(accessLink);\n            \n            accessLink.addEventListener('click', function() {\n                window.open('https:\/\/calendar.google.com\/calendar\/u\/0?cid=aWxrcGg5aTBmOWxpMDBzMXFkOWFvbW9mNWtAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ', '_blank');\n            });\n        }\n\n        \/\/ Group events by month and returning in a variable\n        function groupEventsByMonth(events) {\n            const eventsByMonth = {};\n            events.forEach(event => {\n                const startDateObject = event.getFirstPropertyValue('dtstart')._time;\n                const year            = startDateObject.year;\n                const month           = startDateObject.month-1 \/\/ Subtract 1 since months in JavaScript start from 0\n                const startDate       = new Date(year, month, startDateObject.day);\n\n                \/\/ Get the name of the month and the year in \"month year\" format (example: \"april 2022\")\n                const monthYear = startDate.toLocaleString('default', { month: 'long', year: 'numeric' });\n\n                if (!eventsByMonth[monthYear])\n                eventsByMonth[monthYear] = [];\n\n                eventsByMonth[monthYear].push({\n                startDate: startDate,\n                summary: event.getFirstPropertyValue('summary') || '',\n                description: event.getFirstPropertyValue('description') || '',\n                location: event.getFirstPropertyValue('location') || ''\n                });\n            });\n            return eventsByMonth;\n        }\n\n        \/\/ Sort events by start date\n        function sortEventsByStartDate(events) {\n            events.sort((event1, event2) => {\n                return new Date(event1.getFirstPropertyValue('dtstart')) - new Date(event2.getFirstPropertyValue('dtstart'));\n            });\n        }\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cd1c9e7 elementor-widget elementor-widget-spacer\" data-id=\"cd1c9e7\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-76d487d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"76d487d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0e50744\" data-id=\"0e50744\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-22675d1 elementor-widget elementor-widget-html\" data-id=\"22675d1\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\n    const mainContent = document.getElementById('content');\n\n    if (mainContent)\n        mainContent.style.paddingTop = '90px';\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Welcome to Make My Day&#8217;s Events Scheduler for the Automotive &amp; EV industry! Simplify your event planning and organization with our powerful scheduling tool. We have curated a comprehensive collection of the industry&#8217;s leading events and conferences, all in one place, to make your experience seamless and hassle-free.<\/p>","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"content-type":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-9817","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/pages\/9817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/comments?post=9817"}],"version-history":[{"count":10,"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/pages\/9817\/revisions"}],"predecessor-version":[{"id":11865,"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/pages\/9817\/revisions\/11865"}],"wp:attachment":[{"href":"https:\/\/www.makemydayapp.com\/de\/wp-json\/wp\/v2\/media?parent=9817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}