Google Chrome input type=“date”

前端 未结 4 2061
广开言路
广开言路 2021-02-20 17:26

I have almost no knowledge of web programming, but I have been tasked to solve something on my company\'s website. Apparently, I have an issue with browsers using HTML5 on a le

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-20 17:58

    The value field for the input type = input needs to be in the format yyyy-MM-dd. Check the W3 standards on this.

    This means you must do something like DateTime.Now.ToString("yyyy-MM-dd"). in your code, I would suggest a custom HtmlHelper.

    The format of the date in the browser is completely dependent on your system settings.

提交回复
热议问题