html5 - How to force the input date format to dd/mm/yyyy? -
this question has answer here:
- how set date format in html date input tag? 11 answers
i have little problem. developing web system , form field type date giving me headache. system brazil users, date format should dd/mm/yyyy. when access site computer portuguese language, date of html form field type works way want. when access site in computer language english date format becomes yyyy-mm-dd. problem because user not notice computer's date format changed, user wants see date in format dd/mm/yyyy.
what need format dd/mm/yyyy regardless of machine settings access site, , without using additional javascript library.
the code used is:
<input type="date" id="date">
no such thing. input type=date
pick whatever system default , show in gui store value in iso format (yyyy-mm-dd). beside aware not browsers support it's not idea depend on input type yet.
if corporate issue, force computer use local regional format (dd-mm-yyyy) , ui show in format (see wufoo link before after changing regional settings, need reopen browser).
see: http://www.wufoo.com/html5/types/4-date.html example
see: http://caniuse.com/#feat=input-datetime browser supports
see: http://www.w3.org/tr/html-markup/input.date.html spec. <- no format attr.
your best bet still use javascript based component allow customize whatever wish.
Comments
Post a Comment