does anyone explain how to set datetime picker in MVC4
i want to select date month and year
give me the instructiuon step by step
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manish Kumar ChoudharyPosted Feb 18, 2015, 6:29 AM
Posted Feb 18, 2015, 7:55 AM
Posted Feb 18, 2015, 7:46 AM
BoundleConfig.cs
cuz Datetime picker as just renamed in BoundleConfig.cs
Posted Feb 18, 2015, 6:27 AM
© @DateTime.Now.Year - My ASP.NET MVC Application
Manish Kumar ChoudharyPosted Feb 18, 2015, 5:32 AM
http://www.asp.net/mvc/overview/older-versions/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-1
http://www.kestrelblackmore.com/blog/jquery-datepicker-mvc4
Manish Kumar ChoudharyPosted Feb 18, 2015, 5:31 AM
@Html.DisplayNameFor(model => model.DOB)
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
@Styles.Render("~/Content/cssjqryUi")
@**@
<script type="text/javascript">
$(document).ready(function () {
$('input[type=datetime]').datepicker({
dateFormat: "dd/M/yy",
changeMonth: true,
changeYear: true,
yearRange: "-60:+0"
});
});
script>
}
And in your mode
[Display(Name = "Date Of Birth")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MMM/yyyy}")]
public System.DateTime DOB { get; set; }