Skip to content

internationalization - date and time formats #41

@jrmartino

Description

@jrmartino

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions