Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set initial hour to present in full calendar

in full Calendar - is there a way to set the "landing hour" of the widget? Currently the first visible hour is 06:00 - if I want the first hour to be seen -15:00 - but I don't won't to lose the hours before (the user still can scroll up and see them) - but the most important data is usually from 15:00 and up..is that can be achieved?

like image 864
user1025852 Avatar asked Dec 07 '22 03:12

user1025852


1 Answers

For version 2 you can use scrollTime option:

$('#calendar').fullCalendar({
    header: {
        right: 'agendaWeek'
    },
    defaultView: 'agendaWeek',
    scrollTime :  "15:00:00" //3pm
});

For version 1 you can use the firstHour option when initializing:

$('#calendar').fullCalendar({
    header: {
        right: 'agendaWeek'
    },
    defaultView: 'agendaWeek',
    firstHour: 15
});

Please see this jsFiddle for a working example: http://jsfiddle.net/gTzkU/. Of course the calendar cannot be scrolled down far enough for 15:00 to be the very first hour shown, but the result for that particular time is that the calendar is scrolled down as far as it will go. Perhaps this is a better illustration, with the calendar set to start at 9:00: http://jsfiddle.net/5p6yN/.

Documentation can be found here: http://arshaw.com/fullcalendar/docs/agenda/firstHour/.

like image 86
Drew Gaynor Avatar answered Jan 04 '23 08:01

Drew Gaynor