【发布时间】:2016-11-30 07:29:46
【问题描述】:
在 fullcalendar.js 中我使用了这个,但在这里我给出了静态值。 我们如何发送在 moment("") 内的日历上显示的月份和年份。这样它就可以正常使用它,它只会在我更改月份时显示 2016 年 9 月,然后刷新它会将我重定向到此页面
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
height: 350,
contentHeight: 300,
aspectRatio: 2,
eventLimit: 6,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listMonth'
},
defaultDate: '<?=date("Y-m-d")?>',
navLinks: false, // can click day/week names to navigate views
businessHours: false, // display business hours
editable: false,
eventLimit: true,
events: [
{
title: '',
start: '',
color: '#ff5c29',
allDay : true,
eventColor: '#000'
},
<?php }?>
<?php foreach($records as $record){ ?>
{
title: '',
start: '',
overlap: false,
color: '',
],
});
var previousDate = moment("2016-09");
$('#calendar').fullCalendar('gotoDate', previousDate);
});
</script>
请帮忙。
【问题讨论】:
标签: javascript