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

Pickadate format based on js format #242

Merged
merged 13 commits into from
Jun 19, 2024

Conversation

r-xyz
Copy link
Contributor

@r-xyz r-xyz commented Jun 18, 2024

Closes #237 by removing hard-coded date/time formatting in kiosks( 1, 2, 3) and mobile view (4, 5).

@r-xyz
Copy link
Contributor Author

r-xyz commented Jun 18, 2024

The new utilities:

  • keep untouched all format which are the same in js and pickadate
  • convert all supported formats which are different to the closest equivalent
  • remove all unsupported formats.

It might not work as expected with very exotic format strings, but it should work in most cases (including default) while avoiding adding an extra setting.

Yet I can add the extra setting as an override, if you prefer.

@rptmat57 rptmat57 changed the base branch from master to 6.1.0.dev June 18, 2024 13:09
@rptmat57
Copy link
Contributor

I think I'd like to have the override options in settings.py, just to be safe

@r-xyz
Copy link
Contributor Author

r-xyz commented Jun 18, 2024

Fixed previous approach (I noticed it was not covering all conversions).
Added optional settings in settings.py; if not set, conversion will be attempted.

NEMO/utilities.py Outdated Show resolved Hide resolved
NEMO/utilities.py Outdated Show resolved Hide resolved
@rptmat57
Copy link
Contributor

looks good, thanks!
would you mind renaming the variables to pickadate_date_format and pickadate_time_format?

NEMO/utilities.py Outdated Show resolved Hide resolved
NEMO/utilities.py Outdated Show resolved Hide resolved
NEMO/utilities.py Outdated Show resolved Hide resolved
NEMO/utilities.py Outdated Show resolved Hide resolved
resources/settings.py Outdated Show resolved Hide resolved
@rptmat57 rptmat57 merged commit 4d57493 into usnistgov:6.1.0.dev Jun 19, 2024
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 this pull request may close these issues.

Date/Time format coherence in pickatime/pickadate
2 participants