Issue 2202: Retain jQuery UI / Moment's current language when loading FullCalendar i18n files
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by agews...@gmail.com, Jul 10, 2014
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.
Jul 14, 2014
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: Retain jQuery UI / Moment's current language when loading FullCalendar i18n files (was: Lazy-loading a calendar screw up jQuery UI I18N configuration)
Status: Accepted
Labels: Type-Bug
Aug 21, 2014
#2 chito...@gmail.com
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
Project Member #3 adamrs...@gmail.com
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