Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 创建日历后更改默认日期(fullcalendar)_Javascript_Jquery_Calendar_Fullcalendar_Sapui5 - Fatal编程技术网

Javascript 创建日历后更改默认日期(fullcalendar)

Javascript 创建日历后更改默认日期(fullcalendar),javascript,jquery,calendar,fullcalendar,sapui5,Javascript,Jquery,Calendar,Fullcalendar,Sapui5,我正在将名为fullcalendar()的JavaScript日历集成到我的SAPUI5网页中。日历在特定选项卡中运行。 现在,我想在创建日历后更改默认日期,以显示特定月份 setCalendar : function () { var that = this; if(!this.todayDate) { this.todayDate = new Date(); } $("#EventBrowserDetail--calendarDiv

我正在将名为fullcalendar()的JavaScript日历集成到我的SAPUI5网页中。日历在特定选项卡中运行。 现在,我想在创建日历后更改默认日期,以显示特定月份

setCalendar : function () {
    var that = this;
    if(!this.todayDate) {
        this.todayDate = new Date();
    }

    $("#EventBrowserDetail--calendarDiv").fullCalendar({
        header: {
            left: 'today',
            center: 'prev title next',
            right: 'month,basicWeek,basicDay'
        },
        defaultDate: that.todayDate,
        editable: false,
        eventLimit: true, // allow "more" link when too many events
        lazyFetching: false,
        eventClick: function(event, jsEvent, view){
            that.campaignSelectHandler(event.id, true, that);
        },
        eventMouseover: function(event, jsEvent, view)
        events: that.eventArray
    });
    [...]
},
我使用this.todayDate在调用函数setCalendar()之前更改开始日期。它第一次工作正常,但是如果日历已经创建过一次,它将保留最后显示的月份。 例如:显示八月,我切换到另一个选项卡并将月份更改为二月。之后,我重新启动事件并再次调用setCalendar(),但它仍然保持在8月份

有什么想法和/或帮助吗


提前感谢!:)

由于日历实例已经存在,您可以使用以下命令告诉插件转到特定日期:

$('#EventBrowserDetail--calendarDiv').fullCalendar('gotoDate', that.todayDate);
参考: