Question

Is there a way to display an input with type time, so that only display mm:ss instead of hh:mm:ss? Note it only needs to work in latest chrome.

Was it helpful?

Solution

Sadly, this is quite a really new feature, and you can't do that for now ; HTML5 specifications states that the time input should accept a valid partial-time as defined in RFC 3339 1

This specification defines partial-time as 2 :

time-hour ":" time-minute ":" time-second

In fact, these definitions are used to represent the wire format, then the browser is able to show this input like he wants ; basically, Chrome displays time input according to the user locale, so you can't really have an hand on it 3.

References

  1. http://dev.w3.org/html5/markup/input.time.html
  2. https://www.rfc-editor.org/rfc/rfc3339#page-6
  3. https://code.google.com/p/chromium/issues/detail?id=161024
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top