Javascript 如何设置标题以在完整日历中仅显示月份名称
如何将完整日历标题设置为仅显示月份名称而不是“月份名称”“年份名称” 我的代码:Javascript 如何设置标题以在完整日历中仅显示月份名称,javascript,jquery,Javascript,Jquery,如何将完整日历标题设置为仅显示月份名称而不是“月份名称”“年份名称” 我的代码: $('#calendar').fullCalendar({ header: { left: 'prev', center: 'title', right: 'next' }, titleFormat: { month: 'MMMM' // Tuesday, Sep 8, 2009 },
$('#calendar').fullCalendar({
header: {
left: 'prev',
center: 'title',
right: 'next'
},
titleFormat: {
month: 'MMMM' // Tuesday, Sep 8, 2009
},
height: 'parent'
});
使用上述代码无效,并且在console.log上显示了一些js错误
moment.min.js?ver=2.22.2:1 Uncaught TypeError: e.toUpperCase is not a function
该消息显示在moment.min.js文件中
有什么我错了吗?您没有定义显示月份名称的视图。检查代码
$('#calendar').fullCalendar({
header: {
left: 'prev',
center: 'title',
right: 'next'
},
// Block should be like this
views: {
week: {
titleFormat: 'MMMM',
},
month: {
titleFormat: 'MMMM',
}
},
height: 'parent'
});
有关更多信息,请参阅
希望它能帮助您:)您能为您的问题创建一个JSFIDLE吗。