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

BUGFIX: Use 12/24 hour format for DateTimePicker depending on configured format #3737

Merged

Conversation

Alvadda
Copy link
Collaborator

@Alvadda Alvadda commented Mar 11, 2024

Currently the DateTimePicker always uses the 12h time format even if the time format specified is in 24h format.

Currently supported hour formats from docs:

g: hour without leading zeros - 12-hour format - 1 through 12
G: hour without leading zeros - 24-hour format - 0 through 23
h: 12-hour format of an hour with leading zeros - 01 through 12
H: 24-hour format of an hour with leading zeros - 00 through 23

This change ensures that the 24h format is used for entering times when a 24h format was configured.

For testing:

dateTime24h:
  type: DateTime
    inspector:
      editorOptions:
        format: d-m-Y H:i
dateTime12h:
  type: DateTime
    inspector:
      editorOptions:
        format: d-m-Y h:i a

Fixes partly : #3412

@github-actions github-actions bot added Feature Label to mark the change as feature 8.4 labels Mar 11, 2024
@mficzel mficzel changed the title FEATURE: Enable 24 hour format for DateTimePicker BUGFIX: Use 12/24 hour format for DateTimePicker depending on configured format Mar 11, 2024
@github-actions github-actions bot added the Bug Label to mark the change as bugfix label Mar 11, 2024
@mficzel mficzel marked this pull request as ready for review March 11, 2024 16:34
@mficzel mficzel removed the Feature Label to mark the change as feature label Mar 11, 2024
Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Alvadda,

nice work! Deriving this from the configured format makes complete sense and I was able to test your change locally to verify that it works like a charm 👍

Just one minor nitpick on the code, that's all :)

Since this is being treated as BUGFIX, the PR should target 8.3 rather than 8.4.

packages/react-ui-components/src/DateInput/dateInput.tsx Outdated Show resolved Hide resolved
packages/react-ui-components/src/DateInput/dateInput.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the adjustments, @Alvadda 👍

@Alvadda Alvadda changed the base branch from 8.4 to 8.3 March 14, 2024 11:00
@github-actions github-actions bot added 8.3 and removed 8.4 labels Mar 14, 2024
@Alvadda Alvadda force-pushed the feature/enable24HourFormatForDateTimePicker branch from 9836bf3 to cf8afd3 Compare March 14, 2024 11:01
@ahaeslich ahaeslich merged commit f957158 into neos:8.3 Mar 14, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.3 Bug Label to mark the change as bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants