如何制作< input type =" date">在Chrome中以本地化格式显示日期? [英] How to make <input type="date"> display the date in localized format in Chrome?
问题描述
我使用HTML5 < input type =date>
,它在Chrome中呈现丰富的输入控件,显示日期格式为 MM / DD / YYYY
。问题是我的应用程序希望以服务器端的本地化格式输入,这意味着 MM.DD.YYYY
。
有什么办法可以改变Chrome浏览器呈现方式并从日期控件中获取输入的方式吗?
I'm using the HTML5 <input type="date">
, which in Chrome renders a rich input control displaying the date in the format MM/DD/YYYY
. The problem is that my application expects input in a localized format server-side, which means MM.DD.YYYY
.
Is there any way I can change the way Chrome renders and takes input from date controls?
Chrome renders the date on the format for the language configured in Settings > Language:
Chrome (and other browsers) always post dates in RFC 3339-format according to the HTML5 standard. Make sure the server accepts date on that format only.
这篇关于如何制作< input type =" date">在Chrome中以本地化格式显示日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!