Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full calendar change date format in week view

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!

like image 988
Ham Avatar asked Sep 06 '12 09:09

Ham


4 Answers

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!

like image 74
ganeshk Avatar answered Sep 18 '22 08:09

ganeshk


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.

like image 31
zelazowy Avatar answered Sep 21 '22 08:09

zelazowy


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

like image 31
Ben Avatar answered Sep 18 '22 08:09

Ben


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
}
like image 39
gihandilanka Avatar answered Sep 19 '22 08:09

gihandilanka