{"id":9542,"date":"2025-07-23T10:42:20","date_gmt":"2025-07-23T09:42:20","guid":{"rendered":"https:\/\/edenalvor.com\/eventos\/"},"modified":"2025-10-22T12:32:58","modified_gmt":"2025-10-22T11:32:58","slug":"eventos","status":"publish","type":"page","link":"https:\/\/edenalvor.com\/pt-pt\/eventos\/","title":{"rendered":"Eventos"},"content":{"rendered":"    <script>\n            let piecalAJAX = {\n            ajaxURL: \"https:\/\/edenalvor.com\/wp-admin\/admin-ajax.php\",\n            ajaxNonce: \"ba528aa4dc\"\n            }\n\n            let alreadyExpandedOccurrences = [];\n            \n            document.addEventListener('DOMContentLoaded', function() {\n                var pieCalendarFirstLoad = true;\n                var calendarEl = document.getElementById('calendar');\n                var calendar = new FullCalendar.Calendar(calendarEl, {\n                    headerToolbar: false,\n                    initialView: \"dayGridMonth\",\n                    editable: false,\n                    events: [],\n                    direction: \"ltr\",\n                    contentHeight: \"auto\",\n                    locale: \"pt-PT\",\n                    eventTimeFormat: {\"hour\":\"2-digit\",\"minute\":\"2-digit\"},\n                    dayHeaderFormat: { weekday: 'long' },\n                    eventClick: function( info ) {\n                        Alpine.store(\"calendarEngine\").eventTitle = info.event._def.title;\n                        Alpine.store(\"calendarEngine\").eventStart = info.event.start;\n                        Alpine.store(\"calendarEngine\").eventEnd = info.event.end;\n                        Alpine.store(\"calendarEngine\").eventDetails = info.event._def.extendedProps.details;\n                        Alpine.store(\"calendarEngine\").eventUrl = info.event._def.extendedProps.permalink;\n                        Alpine.store(\"calendarEngine\").eventAllDay = info.event.allDay;\n                        Alpine.store(\"calendarEngine\").eventType = info.event._def.extendedProps.postType;\n                        Alpine.store('calendarEngine').showPopover = true;\n                        Alpine.store('calendarEngine').eventActualEnd = info.event._def.extendedProps.actualEnd;\n                        Alpine.store('calendarEngine').appendOffset = \"\";\n\n                        \/\/ Always pass through event data via the URL if it's a recurring instance, or if adaptive timezones are enabled.\n                        \/\/ Do not pass through event data via the URL if it's a non-recurring instance and adaptive timezones are disabled.\n                        if( info.event._def.extendedProps.isRecurringInstance || ( !info.event._def.extendedProps.isRecurringInstance && piecalVars.useAdaptiveTimezones && Alpine.store('calendarEngine').appendOffset ) ) {\n                            \/\/ Construct the URL with parameters\n                            const baseUrl    = info.event._def.extendedProps.permalink;\n                            const eventStart = new Date( info.event.start );\n                            const eventEnd   = new Date( info.event.end );\n                            const viewerTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n\n                            const url        = new URL( baseUrl );\n                            url.searchParams.append( 'eventstart', Math.floor( eventStart.getTime() \/ 1000 ) );\n                            url.searchParams.append( 'eventend', Math.floor( eventEnd.getTime() \/ 1000 ) );\n                            url.searchParams.append( 'timezone', viewerTimezone );\n\n                            \/\/ Assign the constructed URL to the store\n                            Alpine.store(\"calendarEngine\").eventUrl = url.toString();\n                        }\n\n                        \n                        if( info.jsEvent.type == \"keydown\" ) {\n                            setTimeout( () => {\n                                document.querySelector('.piecal-popover__inner > button').focus();\n                            }, 100);\n                        }\n                    },\n                    eventDataTransform: function(event) {  \n                        \/\/ Safely decode encoded HTML entities for output as titles\n                        let scrubber = document.createElement('textarea');\n                        scrubber.innerHTML = event.title;\n                        event.title = scrubber.value;\n\n                        \/\/ Extend end date for all day events that span multiple days\n                        let { actualEnd, end } = piecalUtils.getAlldayMultidayEventEnd( event ) ?? {};\n\n                        if( actualEnd && end ) {    \n                            event.actualEnd = actualEnd;\n                            event.end = end;\n                        }\n\n                        \n                        return event;  \n                    },\n                    dateClick: function( info ) {\n                        if( info.jsEvent.target.tagName != 'A' ) return;\n\n                        this.gotoDate(info.dateStr);\n                        piecalChangeView('listDay');\n                        \n\n                                            },\n                    eventDidMount: function( info ) {\n                        let link = info.el;\n\n                        const locale = info.view.dateEnv.locale.codeArg;\n\n                        const formattedTime = new Intl.DateTimeFormat(locale, {\n                            hour: 'numeric',\n                            minute: 'numeric',\n                            hour12: true\n                        });\n\n                        const formattedDate = new Intl.DateTimeFormat(locale, {\n                            day: 'numeric',\n                            month: 'numeric',\n                            year: 'numeric'\n                        });\n\n                        if( link.tagName == 'TR' ) {\n                            link = info.el.querySelector('a');\n                        }\n\n                        if( !link || link.tagName != \"A\" ) return;\n\n                        link.setAttribute('role', 'button');\n                        link.setAttribute('href', 'javascript:void(0)');\n\n                        if( info.event.allDay ) {\n                            \/* Translators: Text for all-day event description. *\/\n                            const allDayDescriptionText = 'All-day event';\n\n                            link.setAttribute('aria-label', `${allDayDescriptionText} - ${info.event.title}`);\n                        }\n\n                        \/\/ Handle multi-day event aria label to let screen readers know the event spans multiple days\n                        if( info.event.end && (info.event.end - info.event.start) > (24 * 60 * 60 * 1000) ) {\n                            \n                            const startDate = formattedDate.format(info.event.start);\n                            const startTime = info.event.allDay ? '' : formattedTime.format(info.event.start);\n\n                            const endDate = formattedDate.format(info.event.end);\n                            const endTime = info.event.allDay ? '' :formattedTime.format(info.event.end);\n\n                            \/* Translators: Text describing span of multi-day event. *\/\n                            const spanText = 'to';\n\n                            \/* Translators: Text for multi-day event description. *\/\n                            const multiDayDescriptionText = 'Multi-day event running from';\n\n                            \/* Translators: Text for multi-day all-day event description. *\/\n                            const multiDayAllDayDescriptionText = 'Multi-day, all-day event running from';\n\n                            const descriptionText = info.event.allDay ? multiDayAllDayDescriptionText : multiDayDescriptionText;\n\n                            \/* Translators: Text describing span of multi-day event. *\/\n                            link.setAttribute('aria-label', `${descriptionText} ${startDate} ${startTime} ${spanText} ${endDate} ${endTime} - ${info.event.title}`);\n                        }\n\n                                            },\n                    dayCellDidMount: function( info ) {\n                        let dayLink = info.el.querySelector('.fc-daygrid-day-top a');\n\n                        if( !dayLink ) return;\n\n                        dayLink.setAttribute('role', 'button');\n                        dayLink.setAttribute('href', 'javascript:void(0)');\n\n                        \/\/ Prevent double read out of button label\n                        dayLink.closest('td').removeAttribute('aria-labelledby');\n                        \n                        setTimeout( () => {\n                            if( info.el.querySelector('.fc-daygrid-day-events .fc-daygrid-event-harness') ) {\n                                dayLink.setAttribute('aria-label', dayLink.getAttribute('aria-label') + ', has events.');\n                            }\n                        }, 100);\n\n                        dayLink.addEventListener('keydown', (event) => {\n                            if( event.key == \"Enter\" || event.key == ' ' ) {\n                                event.preventDefault();\n                                window.calendar.gotoDate(info.date);\n                                piecalChangeView('listDay');\n\n                                setTimeout( () => {\n                                    let focusTarget = document.querySelector('.fc-list-day-text');\n                                    focusTarget?.setAttribute('tabindex', '0');\n                                    focusTarget?.focus();\n                                }, 100);\n                            }\n                        })\n\n                                            },\n                    dayHeaderContent: function( info ) {\n                        let overriddenDayHeaderViews = ['dayGridMonth', 'timeGridWeek', 'dayGridWeek'];\n\n                        if( overriddenDayHeaderViews.includes(info.view.type) ) {\n                            return '';\n                        }\n\n                        \n                        return info.text;\n                    },\n                    dayHeaderDidMount: function( info ) {\n                        let dayHeaderLink = info.el.querySelector('a');\n\n                        let fullDayName = piecalUtils.getShortenedDayNames(info.text, 'full');\n                        let shortDayName = piecalUtils.getShortenedDayNames(info.text, 'short');\n                        let singleLetterDayName = piecalUtils.getShortenedDayNames(info.text, 'single');\n\n                        let shortenableViews = ['dayGridMonth', 'timeGridWeek', 'dayGridWeek'];\n\n                        if( shortenableViews.includes(info.view.type) ) {\n                            dayHeaderLink.innerHTML = `<span class=\"piecal-grid-day-header-text piecal-grid-day-header-text--full\">${fullDayName}<\/span>\n                                                       <span class=\"piecal-grid-day-header-text piecal-grid-day-header-text--short\">${shortDayName}<\/span>\n                                                       <span class=\"piecal-grid-day-header-text piecal-grid-day-header-text--single-letter\">${singleLetterDayName}<\/span>`;\n                        }\n\n                                            },\n                                    });\n                    calendar.render();\n                    window.calendar = calendar;\n            });\n\n            function piecalChangeView( view ) {\n                document.querySelector('.piecal-wrapper').setAttribute('data-view', view);\n                window.calendar.changeView(view);\n                Alpine.store('calendarEngine').calendarView = view;\n                Alpine.store('calendarEngine').viewTitle = window.calendar.currentData.viewTitle;\n                Alpine.store('calendarEngine').viewSpec = window.calendar.currentData.viewSpec.buttonTextDefault;\n            }\n\n            function piecalGotoToday() {\n                console.log('today');\n            }\n\n            function piecalNextInView() {\n                window.calendar.next();\n            }\n\n            function piecalPreviousInView() {\n                console.log('prev');\n            }\n\n            function piecalSkipCalendar() {\n                let focusedCalendar = document.querySelector('.piecal-wrapper:focus-within');\n                let focusablesInCalendar = focusedCalendar.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"]');\n                let lastFocusable = focusablesInCalendar[focusablesInCalendar.length - 1];\n\n                let focusablesInDocument = document.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"]');\n                let targetFocusable = Array.prototype.indexOf.call(focusablesInDocument, lastFocusable) + 1;\n\n                focusablesInDocument[targetFocusable].focus();\n            }\n\n            document.addEventListener('alpine:init', () => {\n                Alpine.store('calendarEngine', {\n                    viewTitle: \"Loading\",\n                    viewSpec: \"Loading\",\n                    buttonText: {},\n                    showPopover: false,\n                    locale: \"pt-PT\",\n                    localeDateStringFormat: {\"hour\":\"2-digit\",\"minute\":\"2-digit\"},\n                    allDayLocaleDateStringFormat: [],\n                    calendarView: \"dayGridMonth\",\n                    eventTitle: \"Loading...\",\n                    eventDetails: \"Loading...\",\n                    eventType: \"Loading...\",\n                    eventStart: \"Loading...\",\n                    eventAllDay: false,\n                    eventActualEnd: null,\n                    eventEnd: \"Loading...\",\n                    eventUrl: \"\/\",\n                    safeOutput( input ) {\n                        let scrubber = document.createElement('textarea');\n                        scrubber.innerHTML = input;\n                        return scrubber.value;\n                    }\n                })\n            })\n\n            window.addEventListener('DOMContentLoaded', () => {\n                Alpine.store('calendarEngine').viewTitle = window.calendar.currentData.viewTitle;\n                Alpine.store('calendarEngine').viewSpec = window.calendar.currentData.viewSpec.buttonTextDefault;\n                Alpine.store('calendarEngine').buttonText = window.calendar.currentData.localeDefaults.buttonText;\n            })\n\n            window.addEventListener('keydown', (e) => {\n                if( e.keyCode == 27 || e.key == 'Escape' ) Alpine.store('calendarEngine').showPopover = false;\n\n            })\n        <\/script>\n        <div \n        class=\"piecal-wrapper\" \n        data-view=\"dayGridMonth\";\n        x-data\n        >\n            <div class=\"piecal-controls fc\">\n                <button\n                    class=\"piecal-controls__skip-calendar fc-button fc-button-primary\"\n                    onClick=\"piecalSkipCalendar()\">\n                        Skip Calendar                <\/button>\n                <div\n                class=\"piecal-controls__view-title\" \n                aria-live=\"polite\"\n                role=\"status\"\n                >\n                  <span class=\"visually-hidden\" x-text=\"$store.calendarEngine.viewTitle + ' - current view is ' + $store.calendarEngine.calendarView\"><\/span>\n                  <span aria-hidden=\"true\" x-text=\"$store.calendarEngine.viewTitle\"><\/span>\n                <\/div>\n                <button \n                    class=\"piecal-controls__back-to-month fc-button fc-button-primary\"\n                    aria-label=\"Back to full month view.\"\n                    onClick=\"piecalChangeView('dayGridMonth')\">\n                        Back To Full Month                <\/button>\n                <label class=\"piecal-controls__view-chooser\">\n                    Choose View                    <select x-model=\"$store.calendarEngine.calendarView\" @change=\"piecalChangeView($store.calendarEngine.calendarView)\">\n                        <option value=\"dayGridMonth\">\n                            Month - Classic                        <\/option>\n                        <option value=\"listMonth\">\n                            Month - List                        <\/option>\n                        <option value=\"timeGridWeek\">\n                            Week - Time Grid                        <\/option>\n                        <option value=\"listWeek\">\n                            Week - List                        <\/option>\n                        <option value=\"dayGridWeek\">\n                            Week - Classic                        <\/option>\n                        <option value=\"listDay\">\n                            Day                        <\/option>\n                    <\/select>\n                <\/label>\n                <div class=\"piecal-controls__navigation-button-group\">\n                    <button \n                    class=\"fc-button fc-button-primary piecal-controls__today-button\"\n                    @click=\"window.calendar.today(); $store.calendarEngine.viewTitle = window.calendar.currentData.viewTitle\"\n                    x-text=\"$store.calendarEngine.buttonText.today ?? 'Today'\">\n                    <\/button>\n                    <button \n                    class=\"fc-button fc-button-primary piecal-controls__prev-button\"\n                    @click=\"window.calendar.prev(); $store.calendarEngine.viewTitle = window.calendar.currentData.viewTitle\"\n                    :aria-label=\"$store.calendarEngine.buttonText.prev + ' ' + $store.calendarEngine.viewSpec\"><<\/button>\n                    <button \n                    class=\"fc-button fc-button-primary piecal-controls__next-button\"\n                    @click=\"window.calendar.next(); $store.calendarEngine.viewTitle = window.calendar.currentData.viewTitle\" \n                    :aria-label=\"$store.calendarEngine.buttonText.next + ' ' + $store.calendarEngine.viewSpec\">><\/button>\n                <\/div>\n            <\/div>\n            <div id=\"calendar\"><\/div>\n            <div \n                class=\"piecal-popover\" \n                x-show=\"$store.calendarEngine.showPopover\"\n                style=\"display: none;\">\n                    <div \n                    class=\"piecal-popover__inner\" \n                    role=\"dialog\"\n                    aria-labelledby=\"piecal-popover__title--01\"\n                    aria-describedby=\"piecal-popover__details--01\"\n                    @click.outside=\"$store.calendarEngine.showPopover = false\"\n                    x-trap.noscroll=\"$store.calendarEngine.showPopover\">\n                        <button \n                        class=\"piecal-popover__close-button\" \n                        title=\"Close event details\"\n                        @click=\"$store.calendarEngine.showPopover = false\">\n                        <\/button>\n                                                <p class=\"piecal-popover__title\" id=\"piecal-popover__title--01\" x-text=\"$store.calendarEngine.safeOutput( $store.calendarEngine.eventTitle )\">Event Title<\/p>\n                                                <hr>\n                        <div class=\"piecal-popover__meta\">\n                                                        <p>\n                            Starts                            <\/p>\n                            <p \n                            aria-labelledby=\"piecal-event-start-date\" \n                            x-text=\"!$store.calendarEngine.eventAllDay ? new Date($store.calendarEngine.eventStart).toLocaleDateString( $store.calendarEngine.locale, $store.calendarEngine.localeDateStringFormat ) : new Date($store.calendarEngine.eventStart).toLocaleDateString( $store.calendarEngine.locale, $store.calendarEngine.allDayLocaleDateStringFormat )\"><\/p>\n                            <p x-show=\"$store.calendarEngine.eventEnd\">\n                            Ends                            <\/p>\n                            <p \n                            x-show=\"$store.calendarEngine.eventEnd\" \n                            x-text=\"!$store.calendarEngine.eventAllDay ? new Date($store.calendarEngine.eventEnd).toLocaleDateString( $store.calendarEngine.locale, $store.calendarEngine.localeDateStringFormat ) : new Date($store.calendarEngine.eventActualEnd).toLocaleDateString( $store.calendarEngine.locale, $store.calendarEngine.allDayLocaleDateStringFormat )\"><\/p>\n                                                    <\/div>\n                        <!-- Testing google calendar link.\n                        <hr>\n                        <div>\n                        <p><a href=\"\" class=\"orange\" target=\"_blank\">Add to Google Calendar<\/a><\/p>\n                        <\/div>\n                         until here -->\n                        <hr>\n                                                <p class=\"piecal-popover__details\" id=\"piecal-popover__details--01\" x-text=\"$store.calendarEngine.safeOutput( $store.calendarEngine.eventDetails )\"><\/p>                                                                        <a class=\"piecal-popover__view-link\" :href=\"$store.calendarEngine.eventUrl\">\n                        View                            <!-- <span x-text=\"$store.calendarEngine.eventType\"><\/span> -->\n                                <span>event<\/span>\n                                                    <\/a>\n                                            <\/div>\n            <\/div>\n        <\/div>\n        <div class=\"piecal-footer\">\n                    <\/div>\n        \n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_piecal_is_event":false,"_piecal_start_date":"","_piecal_end_date":"","_piecal_is_allday":false,"footnotes":""},"class_list":["post-9542","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/pages\/9542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/comments?post=9542"}],"version-history":[{"count":1,"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/pages\/9542\/revisions"}],"predecessor-version":[{"id":9544,"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/pages\/9542\/revisions\/9544"}],"wp:attachment":[{"href":"https:\/\/edenalvor.com\/pt-pt\/wp-json\/wp\/v2\/media?parent=9542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}