jquery 如何更改 FullCalendar 中的第一天属性
How to rechange firstDay properties in FullCalendar by jquery
当我更改查看模式月 -> 周时,我想通过 jquery 重新更改 FullCalendar 的 firstDay 属性的值。
初始
$('#calendar').fullCalendar({ firstDay: 0 })
改为
$('#calendar').fullCalendar({ firstDay: moment().weekday() })
但是不行。
我认为它的代码将放在 viewRender 函数中,但我不知道该怎么做?
请帮助我,非常感谢。
您应该可以像这样在初始化后更改 firstDay 选项
$('#calendar').fullCalendar('option', 'firstDay', moment().weekday());
这需要 2.9.0 或更高版本。
这是描述日历选项的 getter 和 setter 的文档页面 https://fullcalendar.io/docs/utilities/dynamic_options/
当我更改查看模式月 -> 周时,我想通过 jquery 重新更改 FullCalendar 的 firstDay 属性的值。
初始
$('#calendar').fullCalendar({ firstDay: 0 })
改为
$('#calendar').fullCalendar({ firstDay: moment().weekday() })
但是不行。
我认为它的代码将放在 viewRender 函数中,但我不知道该怎么做?
请帮助我,非常感谢。
您应该可以像这样在初始化后更改 firstDay 选项
$('#calendar').fullCalendar('option', 'firstDay', moment().weekday());
这需要 2.9.0 或更高版本。
这是描述日历选项的 getter 和 setter 的文档页面 https://fullcalendar.io/docs/utilities/dynamic_options/