My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2251: Using moment.format() when appending start and end parameters does not work well when a language is set
1 person starred this issue and may be notified of changes. Back to list
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by chito...@gmail.com, Aug 21, 2014
I am experiencing this with 2.1.0 beta 3. I _fetchEventSource, lines 1646 and 1467, there are calls to format on a moment object with no parameters. This causes moment to return the localized string for the date when a language is set. The format call should be hardcoded with YYYY-MM-DD.
Aug 22, 2014
Project Member #1 adamrs...@gmail.com
Are you sure? a .format() call with no args should *always* return an ISO8601 string, regardless of locale.

If you still feel this is a bug, please open a new issue w/ a JSFiddle recreation demonstration of the bug:
http://arshaw.com/fullcalendar/wiki/Reporting-Bugs/
Status: Invalid
Aug 22, 2014
#2 chito...@gmail.com
Here is what I am seeing when changing the language to Arabic: 

/calendar/220?start=%D9%A2%D9%A0%D9%A1…%A6&end=%D9%A2%D9%A0%D9%A1%D9%A4-%D9%A0%D9%A9-%D9%A0%D9%A6&_=1408764981044

Logging rangeStart.format() produces some non ascii text.

I fixed it by doing: 

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);
}

Here is a jsfiddle: http://jsfiddle.net/on4cs7o8/
Aug 22, 2014
Project Member #3 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Reproducing
Labels: Type-Bug
Aug 21, 2015
Project Member #4 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2516

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

Powered by Google Project Hosting