Reputation: 1691
I am using jQuery Full calendar.
But I am not getting how to set the week view as Default view in full calendar.
Upvotes: 18
Views: 49685
Reputation: 1
$("#calendar").fullCalendar({
initialView: 'timeGridWeek',
...
});
https://fullcalendar.io/docs/initialView
work for me in ver 5.11.0
Upvotes: 0
Reputation: 19
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
initialView: 'timeGridWeek',
With newer version defaultView will not work, try initialView, make sure the value matches the options listed under your headerToolbar.
Upvotes: 1
Reputation: 1342
As for Version 4, use
defaultView: 'timeGridWeek',
or
defaultView: 'dayGridWeek',
reference: https://fullcalendar.io/docs/defaultView
Upvotes: 0
Reputation: 173
To get a calendar with a view of the week and hours:
$('#calendar').fullCalendar({
defaultView: 'agendaWeek'
});
Upvotes: 2
Reputation: 1604
Try this agendaWeek
$('#calendar').fullCalendar({
theme: true,
header: {
left: 'prev,today,next',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'agendaWeek',
.....
})
Upvotes: 1
Reputation: 100175
Try:
$('#calendar').fullCalendar({
defaultView: 'basicWeek'
aspectRatio: 1.5
});
Ref: FullCalendar Available Views
Edited:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultView: 'basicWeek'
....
Upvotes: 42
Reputation: 30666
Use the defaultView
option:
$('#myCalendar'-.fullcalendar({
defaultView: 'basicWeek'
})
Upvotes: 3