我在使用 fullCalendar 的页面中有以下代码。我可以在我的页面中添加事件,但是日历不会动态显示。在显示我添加的日期之前,我必须移动到另一个月(然后回到当前月)。
有没有办法在以编程方式添加日期时动态刷新/渲染日历?
到目前为止,这是我的代码片段:
## the code for generating the calendar
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
editable: false,
events: 'http://example.com/getevents.php',
});
});
</script>
<h1>Calendar Test</h1>
<div id='calendar'></div>
## the code for updating it
$('#calendar').fullCalendar( 'refetchEvents' );