我有一个使用JQuery Mobile的MVC 4网站。我正在使用带有EditorFor的模型来呈现日期编辑器。在MVC我有这样的:JQuery Mobile日期选取器未在Chrome中显示日期
@Html.EditorFor(Function(model) model.ActionDate)
模型属性定义为:
<Required>
<RegularExpression("\d{2}/\d{2}/\d{4}", ErrorMessage:="Please enter a date in the format of MM/DD/YY")>
<DataType(DataType.Date)>
<DisplayFormat(ApplyFormatInEditMode:=True, DataFormatString:="MM/dd/yyyy")>
<Display(Name:="Action Date")>
Public Property ActionDate As Date
它使得HTML与价值:
<input type="date" ... value="04/24/2013" />
但是显示给用户的是这样的:
日期对用户不可见,并且4/24/2013不是Chrome日期选择器的默认值。我如何获得chrome来实际显示日期?
谢谢。
Chrome浏览器正在为日期字段*进行各种“智能”编辑,这些日期字段正在推动我们坚持*。我的解决方案(下文)只是简单地将字段类型从'date'改为'text'。 –