本文介绍了周历标题的全日历格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些天,我正在使用全日历.我想更改周视图中日期的格式.我发现许多人都成功使用columnFormat:{month:'ddd',week:'ddd d/M',day:'dddd d/M'},但这对我不起作用.也许存在的理由是我使用西班牙语作为语言?这是我的日历代码以及我要执行的操作.谢谢.

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:

如果我删除columnFormat行的'//',就像:

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

有人可以帮助我吗?谢谢.

Can someone help me? Thank you.

推荐答案

使用完整日历的特定视图选项

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

从您的代码中删除 columnFormat 并设置 views 配置.

remove columnFormat from your code and set views config.

这篇关于周历标题的全日历格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 12:03
查看更多