I've added jQueryUI DatePicker
on HtmlTextBoxFor
in my MVC application. Below is my code. Now when I debug, The date shows 01/01/2001 12:00:00
in the create
event instead of the date selected.
<!-- JoinDate -->
<div class="form-group">
<div class="editor-label">
@Html.LabelFor(model => model.JoinDate, new { @class = "col-sm-2 control-label" })
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.JoinDate, new { @class = "form-control", @id = "datepicker" })
@Html.ValidationMessageFor(model => model.JoinDate)
</div>
<script src="~/Content/js/jquery.js"></script>
<script src="~/Scripts/jquery-ui-1.11.4.min.js"></script>
<script>
$(function () {
$("#datepicker").datepicker();
});