【问题标题】:Fullcalendar Week Title Format全日历周标题格式
【发布时间】:2015-06-25 14:40:15
【问题描述】:

是否可以让 fullcalendar 将周标题显示为单个字母?所以代替默认值:

周一周二周三周四周五周六

如何显示:

S M T W T F S

我试过了:

$('#calendar').fullCalendar({
   header: {
   right: '',
   center: 'prev, title, next',
   left: ''
  },
  columnFormat: {
    month: 'd' //also tried 'D' but a number displayed instead
  }
)}

【问题讨论】:

    标签: javascript fullcalendar


    【解决方案1】:

    你能得到的最短的是两个字母

    $('#calendar').fullCalendar({
       header: {
       right: '',
       center: 'prev, title, next',
       left: ''
      },
      columnFormat: {
        month: 'dd' //also tried 'D' but a number displayed instead
      }
    });
    

    这个库使用矩库,所有可能的格式都可以找到here

    【讨论】:

    • 谢谢,现在将使用两个字母,而不是通过一些技巧将其简化为一个。
    【解决方案2】:

    从 2.2.4 版本开始,

    你必须这样修改。

    $('#calendar').fullCalendar({
        ...
        ...
        ...,
        views: {
            week: { // name of view
                columnFormat: 'dd'
            }
        }
    });
    

    【讨论】:

      【解决方案3】:

      如果您使用的是 dayGridMonth,则在选项 apply 内,

      dayHeaderFormat: {
          weekday: 'narrow'
      },
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-04-05
        • 2011-03-04
        • 2017-03-30
        • 2021-12-31
        • 1970-01-01
        • 2015-02-08
        • 1970-01-01
        相关资源
        最近更新 更多