0
我在mvc5编程,我有问题。Asp.net mvc 5跨浏览器日期选择器和时间选择器
我的模型:
[DataType(DataType.Date)]
[Required(ErrorMessage = "Required")]
public System.DateTime Date { get; set; }
[DataType(DataType.Time)]
[Required(ErrorMessage = "Required")]
public System.DateTime Time { get; set; }
查看:
<div class="form-group">
@Html.LabelFor(model => model.Date, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Date, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Time, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Time, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Time, "", new { @class = "text-danger" })
</div>
</div>
当我正确地使用谷歌chrome日期选取器和时间选择器显示,但是当我使用Mozilla Firefox浏览器,这只是一个文本框。
我怎么能概括它呢?我希望总是有日期选择器和时间选择器。
FireFox不支持HTML5'input type =“date”'。请参阅[比较表](https://html5test.com/compare/browser/firefox-40/ie-11/chrome-44/safari-9.0.html) –