FullCalendar-显示过去的日期

时间:2020-09-21 20:17:46

标签: javascript fullcalendar fullcalendar-5

我正在使用FullCalendar,并且希望显示较旧的日期,但不能单击。

我也正在使用validRange属性,它运行良好,但是只使它们不可见。

FullCalendar版本5。

这是我的代码:

 document.addEventListener('DOMContentLoaded', function () {
        var calendarEl = document.getElementById('calendar');
        var calendar = new FullCalendar.Calendar(calendarEl, {
            initialView: 'dayGridWeek',
            locale: 'de',
            timeZone: 'Europe/Berlin',
            hiddenDays: [0, 6],
            validRange: {
                start: tomorrow()
            },
            events: 'http://rendezvous.wm/api/available-times/<?php echo $departmentID; ?>',
            headerToolbar: {
                start: 'title', // will normally be on the left. if RTL, will be on the right
                center: '',
                end: 'today prev,next' // will normally be on the right. if RTL, will be on the left
            },
            displayEventEnd: true,
            eventTimeFormat: {
                hour: '2-digit',
                minute: '2-digit',
                hour12: false
            },
            eventClick: function (info) {
                window.location.href = "<?php echo WP_HOME . '/terminvereinbaren-details?'; ?>department_id=<?php echo $departmentID
                  . '&event_start=';?>" + info.event.start.toISOString()+"&event_end="+info.event.end.toISOString()
            },
        });
        calendar.render();
    });

这是屏幕截图:

enter image description here

0 个答案:

没有答案