如何制作< input type =" date">在Chrome中以本地化格式显示日期? [英] How to make <input type="date"> display the date in localized format in Chrome?

查看:140
本文介绍了如何制作< input type =" date">在Chrome中以本地化格式显示日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HTML5 < input type =date> ,它在Chrome中呈现丰富的输入控件,显示日期格式为 MM / DD / YYYY 。问题是我的应用程序希望以服务器端的本地化格式输入,这意味着 MM.DD.YYYY



有什么办法可以改变Chrome浏览器呈现方式并从日期控件中获取输入的方式吗?

解决方案


  1. Chrome在 中为配置的语言格式呈现日期


  2. Chrome(和其他浏览器)总是在 RFC 3339 - 格式根据HTML5标准。确保服务器仅接受该格式的日期。



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?

解决方案

  1. Chrome renders the date on the format for the language configured in Settings > Language:

  2. 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.

这篇关于如何制作&lt; input type =&quot; date&quot;&gt;在Chrome中以本地化格式显示日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆