Skip to content
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

internationalization - date and time formats #41

Open
jrmartino opened this issue Jan 26, 2022 · 0 comments
Open

internationalization - date and time formats #41

jrmartino opened this issue Jan 26, 2022 · 0 comments

Comments

@jrmartino
Copy link
Contributor

jrmartino commented Jan 26, 2022

Date and time formatting is a major issue. It appears that the back end expects dates as JJ/MM/AAAA and time to be in 24 hour format. However, when the locale is en-us, the input on the admin appointment creation form for the datepicker is MM/DD/YYYY - this gets interpreted as JJ/MM/YYYY by the back end. For example, 10 February 2022 is entered for such a user as 02/10/2022 - but the back end interprets this as 2 October 2022. When entering time formats in the same admin form, the default formats ( e.g. 8:00 AM) cannot be parsed by the back end -only 08:00 works for this time of day.

To reproduce: set admin language to english. create a new appointment form, using the date and time pickers to populate these fields. When the form is complete, try to submit - you will get a datatime parese error from the back end showung up in stdout or the logs.

The solution for this would appear to be to have the UI make a translation from the user's localized format to the format expected by the back end upon form creation, and from the back end format to the user's localized format upon display in the UI. This approach was taken in a PR to a version 2 of the appointment plugin - a similar approach should work for version 3, taking into account the current macros and datetime picker.

Solutions were explored in PRs #37 and #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant