Get the formats for a given locale #809
Labels
c: datetime
Component: dates, times, timezones
Proposal
Larger change requiring a proposal
s: comment
Status: more info is needed to move forward
Projects
I'd like to propose a way to get the date formats for a given locale so that when we're parsing and formatting a string into a date, we can provide a label to the user that explains the format that we will accept.
So imagine that we have an date input. Here's some terrible ASCII art of the label and the input:
So we can use
Intl
to format what they type in or what they select from the calendar dropdown:But... we have no browser API for which we can get that format that we want to put in the label. And without that, there's no way to communicate to the user what we expect.
Unless someone is aware of a way to get the format from Intl?
The text was updated successfully, but these errors were encountered: