| Issue 2202: | Retain jQuery UI / Moment's current language when loading FullCalendar i18n files | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I've just noticed the following bug with the latest 2.0.4 version of fullCalendar: in our web app we use it to display some events on a calendar, however, all the needed js and css files are "lazy loaded" once the calendar is requested, something like
function createCal() {
if(!createCal.loaded) {
createCal.loaded = true;
// inject CSS
// inject JS
}
// create calendar
}
Also, the language file we are using is the lang_all.js, but when the above function loads it, it detects that we are using both jQuery UI and Moment, and changes the language configuration for those too, while they're already configured since they're always loaded into the page.
I would say it would be better if the files pertinent to fullCalendar did not interact in such a way with other libraries.
Aug 21, 2014
This is a big problem with non-ascii languages, because the ajax call in _fetchEventSource will format those moment objects using the current locale, which is bad, because the start and end query arguments will not be ascii. I was able to come up with a fix, which I am proposing:
if (startParam) {
var previousLocale = rangeStart.locale();
rangeStart.locale("en");
data[startParam] = rangeStart.format('YYYY-MM-DD');
rangeStart.locale(previousLocale);
}
if (endParam) {
var previousLocale = rangeEnd.locale();
rangeEnd.locale("en");
data[endParam] = rangeEnd.format('YYYY-MM-DD');
rangeEnd.locale(previousLocale);
}
Aug 21, 2015
Discussion for this issue has moved to the following URL: https://github.com/fullcalendar/fullcalendar/issues/2467 This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event. Happy coding, Adam
Status:
ExportedToGithub
|
|
| ► Sign in to add a comment |
Status: Accepted
Labels: Type-Bug