如何将第一次初始化完整日历设置为特定开始日期? [英] How to set full calendar to a specific start date when it's initialized for the 1st time?

查看:129
本文介绍了如何将第一次初始化完整日历设置为特定开始日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调用该函数显示日历时,我想将初始月份设置为任意月份。举例来说,用户在其他地方选择最后一个日期(2011年6月),我希望fullcalendar在2010年4月之前显示4月的月份显示。是的,这只是一个案例,没有道理;-))

在我随后调用显示函数之前,我试图调用'gotodate',但是这似乎不工作

  $('#calendar')。fullCalendar('gotoDate',currentdate); 
$('#calendar')。fullCalendar({
header:{left:'prevYear,prev,today,next,nextYear',
center:'title',right:'month ,basicweek,basicDay'etc ...}

最终有人能提供一个例子说明如何做到这一点解决方案

c $ c $。

$ $ p $ $''$'$'$'''''''。'fullCalendar({
// Options $ b $ ('#calendar')。fullCalendar('gotoDate',currentDate);


I would like to set the initial month to an arbitrary month when I call the function to display the calendar.

Say for example the user selects a date last june (June 2011) somewhere else and I want fullcalendar to show up with a month display of April before (April 2010). And yes, this is just to make a case, not to make sense ;-) )

I tried to call 'gotodate' before I then subsequently call the display function but this doesn't seem to work

$('#calendar').fullCalendar( 'gotoDate', currentdate);
$('#calendar').fullCalendar({
    header: {left: 'prevYear,prev,today,next,nextYear',
         center: 'title', right: 'month,basicWeek,basicDay' etc...}

Could someone eventually please provide an example how to do this properly?

解决方案

You have it backwards. Display the calendar first, and then call gotoDate.

$('#calendar').fullCalendar({
  // Options
});

$('#calendar').fullCalendar('gotoDate', currentDate);

这篇关于如何将第一次初始化完整日历设置为特定开始日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆