I'm using FullCalendar plugin for jQuery in my project. In fullCalendar week view, I can see a row showing the date in following format:-
Sunday 9/6
, Monday 9/7
, Tuesday 9/8
so on...
Actually, I wish to reverse the position of month/day
to day/month
.
How shall I initialize the setting? Thanks!
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!
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.
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
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With