简体   繁体   English

FullCalendar选择月份中的天返回不正确的星期

[英]FullCalendar select day in month returns incorrect week

I have an implementation of the fullcalendar in yii installation. 我在yii安装中实现了fullcalendar。 I use three options month,agendaWeek.agendaDay The problem is, that when i am in the month display and i select a day, the agendaWeek that loads is usually the previous week from the the actually picked. 我使用三个选项month,agendaWeek.agendaDay问题是,当我在月份显示中并选择一天时,加载的scheduleWeek通常是实际选择的前一周。

        'dayClick' => new CJavaScriptExpression("function(date, jsEvent, view) {
                        var currdisplay=view.name;
                        if(currdisplay=='month'){  
                            $('.calendar').fullCalendar( 'changeView', 'agendaWeek'  );
                        }}"),

the options that i have set are 我设置的选项是

'options'=>array(
        'header'=>array(
        'left'=>'prev,next,today',
        'center'=>'title',
        'right'=> 'month,agendaWeek,agendaDay',
    ),
    'minTime' => '09:00:00',
    'maxTime' => '20:00:00',
    'slotDuration' => '01:00:00',
    'slotEventOverlap' => false,
    'defaultTimedEventDuration' => '01:00:00',
    'allDaySlot' => false,
    'allDay' => false,
    'lazyFetching'=>true,
    'weekends' => false,
    'selectable' => true,
    'height' => 'auto',
)

FullClendar version 2.1.1 FullClendar版本2.1.1

Try actually changing the date to the one the user clicked on before changing view. 尝试将日期实际更改为用户单击的日期,然后再更改视图。

$('#calendar').fullCalendar({
    dayClick: function(date, jsEvent, view) {
        if(view.name == 'month') {
            $('#calendar').fullCalendar('gotoDate', date);
            $('#calendar').fullCalendar('changeView', 'agendaWeek');
        }
    }
    ...
});

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

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