最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - FullCalendar, how do I change the date format? - Stack Overflow

programmeradmin3浏览0评论

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?

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?

Share Improve this question asked Feb 28, 2012 at 23:31 Simon KielySimon Kiely 6,04029 gold badges100 silver badges191 bronze badges 1
  • 1 your link didn't work... – Sinetheta Commented Feb 29, 2012 at 3:19
Add a comment  | 

4 Answers 4

Reset to default 6

Sure, you can play with the titleFormat jsFiddle

$('#calendar').fullCalendar({
    titleFormat: {
        month: 'MMMM yyyy',
        week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}",
        day: 'MM/dd'
    },

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',

Check out this link

http://arshaw.com/fullcalendar/docs/text/titleFormat/

You can specify which view you want to edit through this (in your case the day view)

http://arshaw.com/fullcalendar/docs/views/View_Option_Hash/

So you would probably have something along the lines of

titleFormat: {

day: 'dddd, d MMM, yyyy'   //whatever date format you want here
} 

Fullcalender has a few utilities functions you can use. You can get at these after the calender has been loaded through the $.fullCalendar.formatDate(, 'dd/mm'). There are also a few others that are work a look.. http://arshaw.com/fullcalendar/docs/utilities/

发布评论

评论列表(0)

  1. 暂无评论