Hi,
On Page load, if click textbox, calendar is displaying. But if select the date, year is reducing.
For example if i select 10-DEC-2021 in textbox it is displaying as 10-DEC-1921.
Let me know what thing i missed.
As per below code, calendar is binding successfully, but once calendar is selected, year is binding with wrong value.
@Calendar Scripts@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" />
Include Bootstrap Datepicker
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script>
$(document).ready(function () {
$(".getdate").each(function () {
$(this).datepicker(
{
changeYear: true,
format: 'dd MM yy',
todayHighlight: true,
autoclose: true
});
});
});
</script>
@Html.TextBoxFor(m => m.ProjectFromDate, "{0:dd/MM/yy}", new { @id = "txtProjectFromDate", @Value = @ViewBag.ProjectFromDate, @class = "getdate" })
Thanks in Advance.