Full calendar change date format in week view
You can use any type of date format using moment
, this is for the fullcalendar V5 (Version 5)
.
This is the fullcalendar configuration option.
dayHeaderFormat: this.dayHeaderFormatUsingMoment,
This is the javascript function.
dayHeaderFormatUsingMoment(info) {
return moment(info.date.marker).format("ddd, DD/MM/YYYY"); //output : Tue, 21/07/2020
}
For those who are using the FullCalendar v3
It seems that the configuration has changed.
You can use the columnHeader Format, Text, or Html properties
As explained in this very nice documentation:
https://fullcalendar.io/docs/date-display
And apply them to different views following this one:
https://fullcalendar.io/docs/view-specific-options
Look at title_format
option in fullcalendar documentation: http://arshaw.com/fullcalendar/docs/text/titleFormat/ and set desired format in fullcalendar options.
You can also look here for format options for all calendar views.
You need to use the columnFormat
option to customize this.
columnFormat: {
month: 'ddd',
week: 'ddd d/M',
day: 'dddd d/M'
}
Demonstrated in this fiddle. Let me know if this helps!