javascript - 使用月 View ,逐周移动而不是逐月移动

标签 javascript fullcalendar

我正在使用 FullCalendar v2.2.5,当日历使用月 View <时,我想逐周导航而不是逐月/em>.

我看到用于向前导航的函数是this但我无法想出一种方法来改变这种行为。

有什么办法可以做到这一点吗?

最佳答案

默认情况下,如 prev 所述和 next文档:

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/

相关文章:

javascript - 如何使用 Webpack 和 noParse 选项要求 'ace-builds/ace'

javascript - 在 angularjs 形式中使用 ng-model 的边缘情况

javascript - 根据相关div依次追加div

javascript - 监听器不适用于文本字段

javascript - Fullcalendar v2.x IE8 上的月份 View 错误

javascript - 在javascript中解压字符串

css - @media CSS 未在移动网站上显示

javascript - 如何将数组放入事件 : [. 中。]

php - 如果数据库更改,则全日历自动刷新

css - Fullcalendar:更改特定日期的颜色