Html: Proposal: to add the attribute format for input times

Created on 11 Apr 2019  路  3Comments  路  Source: whatwg/html

I have seen multiple questions of the issue of 12/24 format in the forums for input types, some browsers recognized the configuration, others just totally ignore it and it doesn't matter what you do, it's complex to deal forcing developers to use 3rd party plugins because the situation makes unusable in many cases the input time control, for example:

I tried building a small app with an input type in Android:

https://stackoverflow.com/questions/55621090/lang-attribute-ignored-in-android-webview

But it didn't work because in Poland there is 24h format and not 12, but because my emulators use en-US, it didn't matter, yes, I could switch the regional settings, but it's a huge work, it will be good to have a mandatory option or at least make a proposal that the lang should be respected to simplify the work and promote the usage of these controls regularly among developers, avoiding 3rd party solutions or our own plugins.

Thank you in advance for your support.

P.S.
There is even an issue related since 6 years ago in Chromium that proves how important is to have an alternative to encourage Browser vendors to provide an option:

https://bugs.chromium.org/p/chromium/issues/detail?id=263320

additioproposal i18n-tracker needs implementer interest forms

Most helpful comment

To be clear, the attribute would be lang, that's what dictates the "language" concept. Perhaps form controls should have a dedicated locale attribute or some such though. Seems worth considering.

All 3 comments

https://html.spec.whatwg.org/#input-impl-notes already recommends implementations using the language specified by the web developer, but also, this is ultimately up to implementations as they get to decide what the UX is they want to present to their users.

https://html.spec.whatwg.org/#input-impl-notes already recommends implementations using the language specified by the web developer, but also, this is ultimately up to implementations as they get to decide what the UX is they want to present to their users.

Hi @annevk thanks for your answer and I partially agree, but if there is no any attribute, I think vendors can skip it as the case of Chromium project that no reply and the point has been opened for years and might not change in the near future.

To be clear, the attribute would be lang, that's what dictates the "language" concept. Perhaps form controls should have a dedicated locale attribute or some such though. Seems worth considering.

Was this page helpful?
0 / 5 - 0 ratings