什么';在Fullcalendar v4上使用slotLabelFormat的正确方法是什么?

什么';在Fullcalendar v4上使用slotLabelFormat的正确方法是什么?,fullcalendar,Fullcalendar,我一直在尝试在Fullcalendar v4上使用自定义字符串(如'ddddd,MMMM D,YYYY')自定义slotLabelFormat,但我遇到了一个js“context.cmdFormatter不是函数”错误 我试图通过设置“插件:['矩”,“交互”,“resourceTimeline']”(我无法使用导入方法加载矩)来使用矩插件,但随后我得到一个“矩不是函数”错误 谁能给我指出正确的方向吗 <!DOCTYPE html> <html> <head>

我一直在尝试在Fullcalendar v4上使用自定义字符串(如
'ddddd,MMMM D,YYYY'
)自定义slotLabelFormat,但我遇到了一个js“context.cmdFormatter不是函数”错误

我试图通过设置“
插件:['矩”,“交互”,“resourceTimeline']
”(我无法使用导入方法加载矩)来使用矩插件,但随后我得到一个“矩不是函数”错误

谁能给我指出正确的方向吗

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link href='../packages/core/main.css' rel='stylesheet' />
<link href='../packages-premium/timeline/main.css' rel='stylesheet' />
<link href='../packages-premium/resource-timeline/main.css' rel='stylesheet' />
<script src='../packages/core/main.js'></script>
<script src='../packages/moment/main.js'></script>
<script src='../packages/interaction/main.js'></script>
<script src='../packages-premium/timeline/main.js'></script>
<script src='../packages-premium/resource-common/main.js'></script>
<script src='../packages-premium/resource-timeline/main.js'></script>
<script>

  document.addEventListener('DOMContentLoaded', function() {

    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: [ 'moment','interaction', 'resourceTimeline' ],
      locale: 'es',

      now: '2019-08-07',
      editable: true,

      scrollTime: '00:00'
      ,
      eventClick: function (info) {
                   alert('Event: ' + info.event.title);
    alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
    alert('View: ' + info.view.type);
                return false;
            },
      header: {
        left: 'today prev,next',
        center: 'title',
        right: 'resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth,resourceTimelineYear'
      },
      defaultView: 'resourceTimelineDay',
      views: {
        resourceTimelineDay: {
          buttonText: 'day',
          slotDuration: '01:00'
        },
        resourceTimelineWeek: {
          type: 'resourceTimelineWeek',
          //titleFormat: { year: 'numeric', month: '2-digit', day: '2-digit' },
          slotLabelFormat: 'dddd, MMMM D, YYYY',
          duration: { weeks: 1 },
          slotDuration: {days: 1},
          buttonText: 'week'
        }
      },
 dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
      navLinks: true,
      resourceAreaWidth: '20%',
      resourceLabelText: 'Rooms',
      resources: [
        { id: 'a', title: 'Auditorium A' },
        { id: 'b', title: 'Auditorium B', eventColor: 'green' },
        { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
        { id: 'd', title: 'Auditorium D', children: [
          { id: 'd1', title: 'Room D1' },
          { id: 'd2', title: 'Room D2' }
        ] },
        { id: 'e', title: 'Auditorium E' },
        { id: 'f', title: 'Auditorium F', eventColor: 'red' },
        { id: 'g', title: 'Auditorium G' },
        { id: 'h', title: 'Auditorium H' },
        { id: 'i', title: 'Auditorium I' },
        { id: 'j', title: 'Auditorium J' },
        { id: 'k', title: 'Auditorium K' },
        { id: 'l', title: 'Auditorium L' },
        { id: 'm', title: 'Auditorium M' },
        { id: 'n', title: 'Auditorium N' },
        { id: 'o', title: 'Auditorium O' },
        { id: 'p', title: 'Auditorium P' },
        { id: 'q', title: 'Auditorium Q' },
        { id: 'r', title: 'Auditorium R' },
        { id: 's', title: 'Auditorium S' },
        { id: 't', title: 'Auditorium T' },
        { id: 'u', title: 'Auditorium U' },
        { id: 'v', title: 'Auditorium V' },
        { id: 'w', title: 'Auditorium W' },
        { id: 'x', title: 'Auditorium X' },
        { id: 'y', title: 'Auditorium Y' },
        { id: 'z', title: 'Auditorium Z' }
      ],
      events: [
        { id: '1', resourceId: 'b', start: '2019-08-07T02:00:00', end: '2019-08-07T07:00:00', title: 'event 1',color: '#378006' },
        { id: '2', resourceId: 'c', start: '2019-08-07T05:00:00', end: '2019-08-07T22:00:00', title: 'event 2',color: '#378006' },
        { id: '3', resourceId: 'd', start: '2019-08-06', end: '2019-08-08', title: 'event 3',color: 'red' },
        { id: '4', resourceId: 'e', start: '2019-08-07T03:00:00', end: '2019-08-07T08:00:00', title: 'event 4',color: '#378006' },
        { id: '5', resourceId: 'f', start: '2019-08-07T00:30:00', end: '2019-08-07T02:30:00', title: 'event 5',color: '#378006' }
      ]
    });

    calendar.render();
  });

</script>
<style>

  body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
    font-size: 14px;
  }

  #calendar {
    max-width: 900px;
    margin: 50px auto;
  }

</style>
</head>
<body>

  <div id='calendar'></div>

</body>
</html>

document.addEventListener('DOMContentLoaded',function(){
var calendarEl=document.getElementById('calendar');
var calendar=新的完整日历。日历(calendarEl{
插件:['moment','interaction','resourceTimeline'],
区域设置:“es”,
现在:“2019-08-07”,
是的,
滚动时间:“00:00”
,
事件单击:函数(信息){
警报(“事件:”+信息事件标题);
警报('坐标:'+info.jsEvent.pageX+','+info.jsEvent.pageY);
警报(“视图:”+信息视图类型);
返回false;
},
标题:{
左:“今天上一个,下一个”,
中心:'标题',
右图:“resourceTimelineDay、resourceTimelineWeek、resourceTimelineMonth、resourceTimelineYear”
},
defaultView:“resourceTimelineDay”,
观点:{
resourceTimelineDay:{
buttonText:'天',
慢速持续时间:“01:00”
},
资源TimeLineWeek:{
键入:“resourceTimelineWeek”,
//标题格式:{年:'数字',月:'两位数',日:'两位数'},
slotLabelFormat:'dddddd,MMMM D,YYYY',
持续时间:{周:1},
慢速持续时间:{天:1},
buttonText:“一周”
}
},
dayNamesShort:['Dom','Seg','Ter','Qua','Qui','Sex','Sab',],
导航链接:是的,
resourceAreaWidth:'20%',
resourceLabelText:“房间”,
资源:[
{id:'a',标题:'a礼堂'},
{id:'b',标题:'b礼堂',eventColor:'green'},
{id:'c',标题:'c礼堂',eventColor:'orange'},
{id:'d',标题:'d礼堂',儿童:[
{id:'d1',标题:'d1房间'},
{id:'d2',标题:'d2房间'}
] },
{id:'e',标题:'e礼堂},
{id:'f',标题:'f礼堂',事件颜色:'red'},
{id:'g',标题:'g礼堂},
{id:'h',标题:'h礼堂},
{id:'i',标题:'礼堂i'},
{id:'j',标题:'j'礼堂},
{id:'k',标题:'k礼堂},
{id:'l',标题:'l礼堂},
{id:'m',标题:'m'礼堂},
{id:'n',标题:'n号礼堂},
{id:'o',标题:'o'礼堂},
{id:'p',标题:'p礼堂},
{id:'q',标题:'礼堂q'},
{id:'r',标题:'r礼堂},
{id:'s',标题:'s'礼堂},
{id:'t',标题:'t礼堂},
{id:'u',标题:'u'礼堂},
{id:'v',标题:'v礼堂'},
{id:'w',标题:'w'礼堂},
{id:'x',标题:'x礼堂'},
{id:'y',标题:'礼堂y'},
{id:'z',标题:'Auditorium z'}
],
活动:[
{id:'1',resourceId:'b',开始:'2019-08-07T02:00:00',结束:'2019-08-07T07:00:00',标题:'event 1',颜色:'#378006'},
{id:'2',resourceId:'c',开始:'2019-08-07T05:00:00',结束:'2019-08-07T22:00:00',标题:'event 2',颜色:'#378006'},
{id:'3',resourceId:'d',start:'2019-08-06',end:'2019-08-08',title:'event 3',color:'red'},
{id:'4',resourceId:'e',开始:'2019-08-07T03:00:00',结束:'2019-08-07T08:00:00',标题:'event 4',颜色:'#378006'},
{id:'5',resourceId:'f',开始:'2019-08-07T00:30:00',结束:'2019-08-07T02:30:00',标题:'event 5',颜色:'#378006'}
]
});
calendar.render();
});
身体{
保证金:0;
填充:0;
字体系列:Arial、Helvetica Neue、Helvetica、无衬线字体;
字体大小:14px;
}
#历法{
最大宽度:900px;
保证金:50px自动;
}

好的,我自己找到了解决方案,你需要从即时网站(我用过的)添加真实的即时js,否则它不会工作。Sad文件对此并不清楚