由于某种原因,日历不会在移动设备上填充 json 事件。
我尝试使用iPhone 7的Chrome和Safari页面,但它无法正常工作。
countExtra = 0;
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list' ],
header: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
defaultDate: '<?=date("Y-m-d")?>',
editable: false,
navLinks: true, // can click day/week names to navigate views
eventLimit: true, // allow "more" link when too many events
events: {
url: '/wp-content/themes/bridge-child/calendar/routines.php?categories=<?=$_GET["categories"]?>&q=<?=$_GET["q"]?>',
failure: function() {
jQuery("#errorMessage").css("display", "block");
}
},
loading: function(bool) {
document.getElementById('loading').style.display = bool ? 'block' : 'none';
}
});
calendar.render();
});
```javascript
I don't see any error messages.
解决方案:
由于某种原因,Safari 与日期格式冲突,所以我不得不将 2019-01-01 10:00:00 更改为 2019-01-01T10:00:00
只需在日期和时间之间添加一个 T。
之后,Safari和所有移动浏览器开始工作:)