关于 jquery:Fullcalendar.js 在 Weekview 中自定义开始日期?

Fullcalendar.js custom start date in Weekview?

基本上我想在 Fullcalendar js 的一周视图中将今天显示为一周的第一天。我试图在没有运气的情况下在文档中找到正确的方法。但是,今天(2015-04-24)滥用 firstDayfirstDay: 19 我可以实现这一目标(从今天开始的一周):

fullcalendar


要将当前日期设置为一周的开始,请使用 firstDay: (new Date().getDay()),.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$('#calendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'agendaWeek'
    },
    defaultDate: '2015-04-25', // is not setting the Friday to first day in weekview
    editable: false,
    defaultView: 'agendaWeek',
    firstDay: (new Date().getDay()), // returns the day number of the week, works!
    timeFormat: 'HH:mm',
    lang: 'de',
    columnFormat: 'dddd D.M.',
    allDaySlot: false,
    slotDuration: '00:30:00', // default is 30 min
    minTime: '12:00:00',
    maxTime: '23:00:00',
    contentHeight: 600,
    events: [

        {
            title: 'Test',
            start: '2015-04-25T14:00:00',
            end: '2015-04-25T21:00:00',
            dow: [4], // repeat same weekday
            rendering: 'background',
            color: '#6BA5C2'
        },

    ],

    timezone: 'local',

    // ...

}); // end fullCalendar