Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FullCalendar, how do I change the date format?

I am trying to make the date format of FullCalendar dd/mm. How can I do this? I found [this][1] method, but I am not really sure how to edit it in my case. I am trying to make it so that in the dayView, the header shows the date in dd/mm format, rather than the current mm/dd American format.

Is it possible to do this?

like image 799
Simon Kiely Avatar asked Dec 01 '22 23:12

Simon Kiely


2 Answers

Sure, you can play with the titleFormat jsFiddle

$('#calendar').fullCalendar({
    titleFormat: {
        month: 'MMMM yyyy',
        week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}",
        day: 'MM/dd'
    },
like image 96
Sinetheta Avatar answered Dec 10 '22 13:12

Sinetheta


As I have written elsewhere on SO you can use this undocumented config variable to make a general change for all appearances of date/month so you don't have to specify it per view:

dayOfMonthFormat: 'ddd DD/MM',
like image 31
nzn Avatar answered Dec 10 '22 11:12

nzn