I have an html datepicker to select the date. But when I want to select the year, I can only select 10 previous years or 10 future years.
For example, if we are in 2023, I can only see from 2013 to 2033:
But I want to select 2010 and I can't. I know that if I select 2013, then I can see another previous 10 years (now from 2003-2023):
But my question is I f I can increase that limit instead of 10 years, to 20 years. Is that possible? Something like this:
This is the code in the view:
<div class="filter"> <label for="MyDate">Date </label> <%: Html.TextBoxFor(model => model.Date, new { @class = "inputCenterDate", @style = "width:70px;" })%> </div>
.inputCenterDate {
text-align: center;
width: 80px;
font-size: 0.9em;
height: 1.2em;
}
<script type="text/javascript">
$("#Date").datepicker()
.focusout(function (event) {//Format dd/MM/yy to dd/MM/yyyy
var auxF = CheckDateCorrectFormat(this.value);
if (auxF != "") this.value = auxF;
});