usnistgov / NEMO

NEMO is a laboratory logistics web application. Use it to schedule reservations, control tool access, track maintenance issues, and more.
Other
135 stars 63 forks source link

Date/Time format coherence in pickatime/pickadate #237

Open r-xyz opened 3 months ago

r-xyz commented 3 months ago

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 commented 3 months ago

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