New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datepicker in EssenceDate cannot consume localized date format #1245
Comments
I investigated this issue now - and after two hours of debugging I found that this is not related to the jquery datepicker but to chrome! This issue only appears when you are using a type Related links:
Unfortunately the tests in Alchemy are not able to catch the issue because the value of the date field is set correctly, but its not visible to the user. The solution for Alchemy is fairly simple: Edit: Its not that simple... for example in iOS the correct interface for picking the date is shown if the field is from the correct type. Changing to type text would stop iOS from doing that. Edit 2: Actually Alchemy replaces the date type with text already if its not iOS. https://github.com/AlchemyCMS/alchemy_cms/blob/master/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee#L26-L27 but chrome comes first, does not accept the value and throws the warning. |
- [x] Refactor the way the datepicker is initialized This change fixes an issue that appears when you are using a type `date` field. What happens is that google chrome renders its HTML5 input field for dates but complains if the date format is not the same as defined in the users OS settings. You can still save new values, but since the values are localized by Rails they are not being presented in the input field (happens when you enter the page or reload). #1245
I came up with a proposal:
PR: #1246 |
- [x] Refactor the way the datepicker is initialized This change fixes an issue that appears when you are using a type `date` field. What happens is that google chrome renders its HTML5 input field for dates but complains if the date format is not the same as defined in the users OS settings. You can still save new values, but since the values are localized by Rails they are not being presented in the input field (happens when you enter the page or reload). #1245
This was merged in this PR so I will close this issue. |
EssenceDate
should always provide the ISO-8601 time format for the datepicker, e.g. 2017-03-07. Otherwisejquery.datetimepicker
cannot handle the localized date format (when using another locale than EN in the backend interface).We will have a closer look at it this week and provide a fix.
The text was updated successfully, but these errors were encountered: