Can firstHour be called like a method in FullCalendar
When creating the fullCalendar I can set firstHour and have it scroll to that hour, but I only want this to happen when the current d开发者_如何学运维ay is today. If the user goes to the next day, I want the scrollbar to be at the top of the container, but if they come back to today I want it to go to the firstHour again.
Is there a way to call firstHour like a method? Or is there another way to achieve this?
You can check what day you are currently showing with the viewDisplay
callback. But as far as I know you can't change the firstHour option after you have initialized the calendar. You will have to destroy it and then build it again...
viewDisplay: function(view) {
if (view.start.toDateString() === new Date().toDateString()){
alert('Currently showing today!');
}
精彩评论