Skip to content

feat: Add 24h view for time picker#3506

Merged
ronaktruss merged 3 commits into
mainfrom
rp-2947-24h-view
Jun 17, 2026
Merged

feat: Add 24h view for time picker#3506
ronaktruss merged 3 commits into
mainfrom
rp-2947-24h-view

Conversation

@ronaktruss

@ronaktruss ronaktruss commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds optional property to enable military time

Related Issues or PRs

#2947

How To Test

Look at time picker in storybook and review the 24h option.

Screenshots (optional)

image

Author & Maintainer checklist

  • Is this is a breaking change?
    • Yes, and I accounted for the breaking changes according to the linked documentation
    • No
  • Once merged, add the PR and Issue author(s) as a contributor(s) via the all-contributors bot

@ronaktruss ronaktruss requested review from a team as code owners June 16, 2026 22:00
@ronaktruss ronaktruss changed the title Add 24h view for time picker feat: Add 24h view for time picker Jun 16, 2026
export const TIME_PICKER_CUSTOM_FILTER_24H: CustomizableFilter = {
filter: '0?{{ hourQueryFilter }}:{{ minuteQueryFilter }}.*',
extras: {
hourQueryFilter: '([0-9]{1,2})',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could have more specific regex here, but made it as similar to the other TIME_PICKER_CUSTOM_FILTER so that they behave as similar as possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that's the right move. I haven't double checked, but I'm fairly certain a lot of these supporting constants and logic are lifted almost 1:1 from USWDS, so keeping it "similar" is exactly the right call.

@brandonlenz brandonlenz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the storybook example! Made it easy to test.

This was a nice, surgical change. Thanks!

Comment thread src/components/forms/TimePicker/constants.ts Outdated
Comment thread src/components/forms/TimePicker/TimePicker.tsx Outdated
Comment thread src/components/forms/TimePicker/utils.ts Outdated
Comment thread src/components/forms/TimePicker/TimePicker.tsx Outdated
@ronaktruss ronaktruss merged commit 351f789 into main Jun 17, 2026
9 checks passed
@ronaktruss ronaktruss deleted the rp-2947-24h-view branch June 17, 2026 17:22
@brandonlenz

Copy link
Copy Markdown
Contributor

@all-contributors please add @ronaktruss for code

@allcontributors

Copy link
Copy Markdown
Contributor

@brandonlenz

I've put up a pull request to add @ronaktruss! 🎉

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.

2 participants