Hi Ive put in a bootstrap date picker on my asp.net mvc form. Ive set it up so it starts displaying years from a decade.
But the date picker only displays the years as one longer string, its functional though
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/bootstrap")
<script type="text/javascript">
$("#DateOfBirth").datepicker({
format: "dd/mm/yyyy",
startDate: "-120y",
endDate: "-10y",
startView: 2,
calendarWeeks: true,
defaultViewDate: { year: 1975, month: 01, day: 01 }
});
</script>
}
Helper in view
<div class="row">
<div class="col-md-3 col-md-offset-1">
@Html.LabelFor(model => model.DateOfBirth, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.DateOfBirth, new { htmlAttributes = new { @class = "form-control", placeholder = "01/12/80" } })
@Html.ValidationMessageFor(model => model.DateOfBirth, "", new { @class = "text-danger" })
</div>
</div>
Thanks
What it should look like:
What it actually looks like:
As Jasen has pointed out i'd missed the css resource I'm the bundle config. Thanks