We want to use the DatePicker's min and max value to help the user select an appropriate date, but have encountered a blocker. It turns out the DatePicker produces Norwegian text in our English language application.
Regardless of the locale setting, the DatePicker displays the validation error in Norwegian.
Steps to reproduce the bug
Steps to reproduce for min-value, but max-value behaves the same
Create a DatePicker with min value and locale set to anything other than Norwegian, e.g. "en"
Use the keyboard to select a date earlier than the min value
It's expected that the validation error is displayed in the selected language, just as the calendar's months and days use the selected locale's language.
Instead, the validation error is in Norwegian. I don't know why Norwegian is selected in particular, but it's not unreasonable in my case.
Specifications
Version: "@equinor/eds-core-react": "^0.42.0"
Browser: Firefox set to display pages in US English. I have tested it in Edge too, and it's stuck showing English despite the calendar showing German.
OS: Windows using US English as the language and Norwegian date format.
We want to use the DatePicker's min and max value to help the user select an appropriate date, but have encountered a blocker. It turns out the DatePicker produces Norwegian text in our English language application.
Regardless of the locale setting, the DatePicker displays the validation error in Norwegian.
Steps to reproduce the bug Steps to reproduce for min-value, but max-value behaves the same
To quickly reproduce it, go to https://storybook.eds.equinor.com/?path=/story/inputs-dates-datepicker--with-min-and-max-value&locale:en (notice that "en" is selected), and follow the steps. You'll see (American date format and Norwegian validation error)
Expected behavior
It's expected that the validation error is displayed in the selected language, just as the calendar's months and days use the selected locale's language.
Instead, the validation error is in Norwegian. I don't know why Norwegian is selected in particular, but it's not unreasonable in my case.
Specifications
Other info I think I've traced the problem back to Adobe's code in https://github.com/adobe/react-spectrum/blob/main/packages/%40react-stately/form/src/useFormValidationState.ts, so I don't think your code is to blame directly. In any case, something isn't using the specified locale.