简体   繁体   English

只想在fullcalendar插件中显示星期和日期

[英]want to display week and day only in fullcalendar plugin

I am working on jquery fullcalendar plugin. 我正在研究jQuery fullcalendar插件。 This plugin, by default, shows entire and week. 默认情况下,此插件显示整个和一周。 However, I want to display only week and day. 但是,我只想显示一周和一天。 I changed the options for this so that when user loads page then it shoudl automatically load week calendar but it still loads month and to view week user has to click on week tab to see it. 我更改了此选项,以便当用户加载页面时,它应该自动加载周历,但仍加载月,要查看周,用户必须单击“周”选项卡才能看到它。 How can I change this default behavior so that user see week calendar when he loads website? 如何更改此默认行为,以便用户在加载网站时看到周历?

$('#calendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'agendaWeek,agendaDay',
        ignoreTimezone: false
    },
    selectable: true,
    selectHelper: true,
    editable: true,
    events: 'events'
});

Just add defaultView: 'basicWeek' to your fullCalendar option: 只需将defaultView: 'basicWeek'添加到您的fullCalendar选项中即可:

$('#calendar').fullCalendar({
    defaultView: 'basicWeek'
});

Check the documentation 检查文件

Demo 演示版

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM