作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我实现了一个 fullCalendar
,它工作正常,但是一旦我想更改区域设置,就会出现以下错误:
Uncaught TypeError: e.fullCalendar.datepickerLocale is not a function
以下是配置 fullCalendar 的 JS 代码:
loadScript("js/plugin/fullcalendar/locale-all.js", "");
fullviewcalendar = $('#calendar').fullCalendar({
header: hdr,
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
locale: 'fr',
drop: function (date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
select: function (start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent', {
title: title,
start: start,
end: end,
allDay: allDay
}, true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
}
});
我正在使用 jquery 1.12.4
、jqueryui 1.12.
1 和 fullCalendar 3.1.0
、moment 2.17.1
。
如果我没有加载 local-all.js
脚本,我的日历会正确显示,但显示为英语...
您知道为什么我会收到此错误吗?
最佳答案
我知道这是一篇旧帖子,但供将来引用:
我刚刚发现这个函数在 fullCalendar v3 中从“Lang”重命名为“Locale”。
https://fullcalendar.io/docs/v3/lang
如果您遇到有关 v3+ 的兼容性问题,您可以尝试将函数 x.fullCalendar.datepickerLocale
更改为 x.fullCalendar.datepickerLang
,反之亦然
为我工作,希望它对其他人也有用
关于javascript - fullcalendar locale 未捕获类型错误 : e. fullCalendar.datepickerLocale 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41746842/
我实现了一个 fullCalendar ,它工作正常,但是一旦我想更改区域设置,就会出现以下错误: Uncaught TypeError: e.fullCalendar.datepickerLocal
我是一名优秀的程序员,十分优秀!