moonwalker
moonwalker

Reputation: 1177

Bootstrap datepicker: Start picking date from year

Normally when selecting dates from immediate vicinity of 'today', default behaviour (picking a day of month) works well but when picking birthdays I want the user to start picking the date from years. I looked at the docs but couldn't find any option to do this. I want the datepicker to open with years selection first. As shown in this picture:

enter image description here

I'm using this plugin: https://bootstrapdatepicker.readthedocs.io/en/latest/

Upvotes: 0

Views: 931

Answers (1)

tata.leona
tata.leona

Reputation: 1058

Use startView option (0-days, 1-months, 2-years, see plugin docs):

$('#date').datepicker({
    startView:2//
});

Upvotes: 2

Related Questions