Configuring locale override for HTML5 <input type=date> picker
27K reputation · 23 Jul 2023, 19:56 UTC
The goal is to make the date picker shown by an element display a specific language or format (for example, the ISO‑8601 pattern) independent of the user's system locale or the page's lang attribute. Currently, browsers derive the picker UI from the operating system locale and ignore the lang attribute, while the submitted value is always the canonical 'YYYY‑MM‑DD' string. This creates a mismatch between what users see and what the application receives, and there is no standard HTML attribute or CSS property to override the picker's locale.
Is there a way to force the picker UI to adopt a chosen locale without breaking its native accessibility features? Can a JavaScript polyfill safely replace the picker while preserving keyboard navigation and ARIA roles? Does the HTML5 specification provide any extension point or future attribute that would allow developers to specify the picker's locale explicitly?