Reputation: 2109
I want to do something similar to this: show only weekdays, however, I would like it to start on the first day of the week (or show from Sunday to the next Saturday).
I have tried setting a moment for the start
and intervalStart
option of the first day of the week (i.e. Sunday) but this doesn't seem to work.
Edit (from link above):
$('#calendar').fullCalendar({
header: {
left: '',
center: '',
right: '',
},
editable: true,
views: {
settimana: {
type: 'agendaWeek',
duration: {
days: 7
},
title: 'Apertura',
columnFormat: 'dddd', // Format the day to only show like 'Monday'
hiddenDays: [0, 6] // Hide Sunday and Saturday?
}
},
defaultView: 'settimana',
});
Upvotes: 4
Views: 7008
Reputation: 11
You can add firstDay: 1.
$('#calendar').fullCalendar({
firstDay: 1,
})
or
let calendar = new FullCalendar.Calendar(calendarEl, {
firstDay: 1,
...
});
Upvotes: 1
Reputation: 250
For future reference, for custom views the dateAlignment option can be used to implement something like weekdaysOnlyView.
Upvotes: 2
Reputation: 2109
I was able to do this with:
$('#calendar').fullCalendar({
...
// Added the default date
defaultDate: $.fullCalendar.moment().startOf('week'),
...
});
Upvotes: 1