gpt4 book ai didi

javascript - fullcalendar locale 未捕获类型错误 : e. fullCalendar.datepickerLocale 不是函数

转载 作者:行者123 更新时间:2023-12-03 05:12:34 25 4
gpt4 key购买 nike

我实现了一个 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.4jqueryui 1.12.1 和 fullCalendar 3.1.0moment 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com