Reputation: 1030
I am using http://vitalets.github.io/bootstrap-datepicker/ bootstrap datepicker for user to select there date of birth, all user are above 60, I want to allow them to select year first, then month and date, this plugin support year first, but its showing 2014 when datapicker if focus, I want default selected to be 1950,
<script>
$(document).ready(function () {
var currDate = 1;
var currMonth = 1;
var currYear = 1950;
var dateStr = new Date(currMonth + "/" + currDate + "/" + currYear);
$("#DOB").datepicker({
viewMode: 'years',
startDate : dateStr
});
});
</script>
Upvotes: 0
Views: 1641
Reputation: 1467
There is an option available in the provided link itself-> startView
Syntax: startView : 'decade'
Description :
The view that the datepicker should show when it is opened. Accepts values of 0 or 'month' for month view (the default), 1 or 'year' for the 12-month overview, and 2 or 'decade' for the 10-year overview.
Upvotes: 1