Reputation: 154
Is it possible to get fullcalendar to show week titles as a single letter? So instead of the default:
Mon Tue Wed Thu Fri Sat
how can I display:
S M T W T F S
I've tried:
$('#calendar').fullCalendar({ header: { right: '', center: 'prev, title, next', left: '' }, columnFormat: { month: 'd' //also tried 'D' but a number displayed instead } )}
Upvotes: 2
Views: 3878
Reputation: 658
You can use slotLabelFormat:
slotLabelFormat: [
{ weekday: 'narrow' },
]
All possible formats are in documentation: https://fullcalendar.io/docs/v4/date-formatting
Upvotes: 0
Reputation: 41
If you are using dayGridMonth, inside the option apply ,
dayHeaderFormat: {
weekday: 'narrow'
},
Upvotes: 1
Reputation: 583
From version 2.2.4,
You have to modify like this.
$('#calendar').fullCalendar({
...
...
...,
views: {
week: { // name of view
columnFormat: 'dd'
}
}
});
Upvotes: 1
Reputation: 10746
The shortest you can get is two letters
$('#calendar').fullCalendar({
header: {
right: '',
center: 'prev, title, next',
left: ''
},
columnFormat: {
month: 'dd' //also tried 'D' but a number displayed instead
}
});
This library uses moment library and all possible formats can be found here
Upvotes: 4