如何從JqueryUI Datepicker庫實現DateTime Picker。如何實現JqueryUI Datepicker
到目前爲止,我已經folowed這些步驟http://blog.falafel.com/three-steps-use-jquery-ui-asp-net-mvc-5/ 在哪裏我也做了前3個步驟,現在我現在不如何推動這樣我就可以實現的日期時間選取器?
我有什麼編碼到目前爲止是在模型類我的日期時間變量,像這樣
[DataType(DataType.Date)]
public DateTime Date { get; set; }
在我創建視圖我有這個
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Job</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Date, "Choose Date", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-1">
@Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Date, "", new { @class = "text-danger" })
</div>
</div>
</div>
}
在我BundleConfig類,我有我已執行
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.theme.css"));
並在_Layout.cshtml我已實施
@Scripts.Render("~/bundles/jqueryui")