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) –