Skip to content

Bug: DatePicker format label #630

Merged
mkernohanbc merged 3 commits intomainfrom
bug/datepicker
Feb 5, 2026
Merged

Bug: DatePicker format label #630
mkernohanbc merged 3 commits intomainfrom
bug/datepicker

Conversation

@mkernohanbc
Copy link
Contributor

This PR fixes a bug (introduced in #620) in the DatePicker component.

The format label does not properly handle the case where:

  • DatePicker is in its default state (inside an i18nProvider that sets its locale to en-CA) and
  • The user's browser locale is set to something other than en-CA

In this case, the automatically-generated format label will reflect the browser locale, and thus conflict with the input value format:

Screenshot 2026-02-05 at 11 18 26 AM

3a61200 fixes this by setting a default label for en-CA unless isBrowserLocaleUsed is passed:

Screenshot 2026-02-05 at 11 24 13 AM

This PR also includes a couple of housekeeping changes:

  • 3dbb060 adds a basic suite of unit tests for DatePicker
  • 5a2c9ea adds mocks of the DatePicker to the Vite kitchen sink app

@mkernohanbc mkernohanbc self-assigned this Feb 5, 2026
@mkernohanbc mkernohanbc added the Components Changes or issues affect the design-system-react-components package label Feb 5, 2026
@mkernohanbc mkernohanbc requested a review from ty2k February 5, 2026 19:27
Copy link
Contributor

@ty2k ty2k left a comment

Choose a reason for hiding this comment

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

Good fix!

DatePicker in en-CA and en-US

@mkernohanbc mkernohanbc merged commit b69f483 into main Feb 5, 2026
5 checks passed
@mkernohanbc mkernohanbc deleted the bug/datepicker branch February 5, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Components Changes or issues affect the design-system-react-components package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants