Event date changes if different locale
-
Hi,
I have discovered a bug in the event date parsing. The problem happens when you have system locale different from the one assumed by the plugin (en_US, I guess). How to reproduce:
1. Change you system/browser locale to non-English, e.g. Czech.
2. Edit an event. As you load the page, the date is displayed according to your locale.
3. Click save. According to the description next to the date box: “Errors will reset to today’s date”, the localized date is interpreted as an error and today’s date is set.This doesn’t happen when creating event as the calendar widget saves the input using the correct locale.
For instance: Say I have event happening on 20.1.2015. I would like to edit it on 10.1.2015. If I do so and my locale is Czech, when loading the “Edit Event” page I see that the date is “20 led 2015” (i.e. not “20 jan 2015” as expected by the plugin). Then when I save the event, “20 led 2015” is interpreted as an error and hence 10.1.2015 is used.
How to fix: Before reading in the event date, determine the system’s locale and parse the input accordingly. See for instance https://stackoverflow.com/questions/22737272/php-get-locale-specific-date-format
- The topic ‘Event date changes if different locale’ is closed to new replies.