我正在使用 FullCalendar v2.2.5,当日历使用月 View <时,我想逐周导航而不是逐月/em>.
我看到用于向前导航的函数是this但我无法想出一种方法来改变这种行为。
有什么办法可以做到这一点吗?
最佳答案
If the calendar is in month view, will move the calendar back/forward one month.
If the calendar is in basicWeek or agendaWeek, will move the calendar back/forward one week.
If the calendar is in basicDay or agendaDay, will move the calendar back/forward one day.
如果你想改变它的工作方式,你需要使用 Custom view
,基于月 View 。像这样的东西:
$('#calendar').fullCalendar({
defaultView: 'customMonth',
views: {
customMonth: {
type: 'month',
duration: {weeks: 1}
}
}
});
基本上,您根据month
View 和duration “创建”一个customMonth
View (这是默认 View )这是一个星期。
我做了一个jsfiddle你可以在哪里看到这个工作。
完全披露:此解决方案是根据 this answer 找到的.
关于javascript - 使用月 View ,逐周移动而不是逐月移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40215588/