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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Feb 18, 2015, 1:29 AM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Feb 18, 2015, 12:31 AM EST
@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; }
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Feb 18, 2015, 12:32 AM EST
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
Posted Feb 18, 2015, 1:27 AM EST
© @DateTime.Now.Year - My ASP.NET MVC Application
Posted Feb 18, 2015, 2:46 AM EST
BoundleConfig.cs
cuz Datetime picker as just renamed in BoundleConfig.cs
Posted Feb 18, 2015, 2:55 AM EST