Fullcalendar format of title of weekview

心已入冬 提交于 2021-02-16 19:35:25

问题


These days i'm working with the fullcalendar. I want to change the format of the date in the weekview. I found that many people succeeded with columnFormat: { month: 'ddd', week: 'ddd d/M', day: 'dddd d/M' }, but this one doesn't work for me. Maybe the raison is i used spanish as the language? Here is my code of calendar and what i want to do. Thank you.

    $('#calendar').fullCalendar({
        //defaultView: 'week',
        locale: "es",
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        //defaultDate: '2016-01-12',
        editable: true,
        eventLimit: true, // allow "more" link when too many events
        selectable: true,
        selectHelper: true,
        minTime: "09:30:00",
        maxTime: "19:30:00",
        slotLabelFormat: "h:mm",
        slotDuration: "00:30:00",
        slotLabelInterval: "00:30:00",
        //columnFormat: { month: "ddd", week: "ddd D", day: "dddd" },

        select: function(start, end) {

With this code, i got this one now:

And if i delete the '//' of line of columnFormat, it's like:

Can someone help me? Thank you.


回答1:


Use full calendar View-Specific Options

 views: {
  month: {
    columnFormat: 'dddd' // set format for month here
  },
  week: {
    columnFormat: 'ddd d/M' // set format for week here
  },
  day: {
    columnFormat: 'dddd' // set format for day here
  }
},

remove columnFormat from your code and set views config.




回答2:


You can use this:

columnFormat: {
    month: "ddd",
    week: "ddd dd",
    day: "dddd"
}


来源:https://stackoverflow.com/questions/45505064/fullcalendar-format-of-title-of-weekview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!