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

Date/Time format coherence in pickatime/pickadate #237

Open
r-xyz opened this issue Jun 12, 2024 · 1 comment · Fixed by #242
Open

Date/Time format coherence in pickatime/pickadate #237

r-xyz opened this issue Jun 12, 2024 · 1 comment · Fixed by #242

Comments

@r-xyz
Copy link
Contributor

r-xyz commented Jun 12, 2024

Hi Mathieu,
I noticed hard-coded date/time formatting in kiosks( 1, 2, 3) and mobile view (4, 5).
I was going to submit a PR to make them coherent with all other Django and Fullcalendar variables defined in settings.py, but I soon realized that pickadate library uses another formatting for time and date, which is different from both Django and FullCalendar.

How would you suggest to proceed? Shall I add an two additional variables to settings.py?

@rptmat57
Copy link
Contributor

I think there aren't many options here, outside of adding those variable to settings.py.

The only thing I can think off would be to also try to manually convert from js to pickadate's limited format, if possible.
Since the format for pickadate is extremely limited, it would just consist of a few if statements. See py_to_js_date_formats in utilities.py. I would do something similar or even simpler.

It would only attempt to convert if the new variables are not set in settings.py

r-xyz added a commit to r-xyz/NEMO that referenced this issue Jun 18, 2024
r-xyz added a commit to r-xyz/NEMO that referenced this issue Jun 18, 2024
rptmat57 added a commit that referenced this issue Jun 19, 2024
* Pickadate format now based on js format.
Closes #237

* Pickadate format conversion: remove additional unsupported formats.

* Pickadate format conversion: fix submit format.

* Pickadate format: rename variable.

* Pickadate format: remove additional hardcoded value.

* Pickadate format: fix unsupported removal order.

* Pickadate format: fix typo.

* Pickadate format: fix typo.

* Pickadate format: remove duplicated formats.

* Pickadate format: improved logic.

Also renamed variables.

* Update NEMO/apps/kiosk/templates/kiosk/tool_reservation.html

* Update NEMO/templates/mobile/new_reservation.html

* fixed wrong format for date

---------

Co-authored-by: Mathieu Rampant <mathieu.rampant@gmail.com>
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

Successfully merging a pull request may close this issue.

2 participants