Nectar Mind
Nectar Mind

Reputation: 145

How to open year firstly then month and then date when bootstrap calender is opened

I am making an application and need to choose DOB for user profile. I am using bootstrap datepicker for DOB field but I need to open year first then month and date for date of birth(DOB).

Here is my config code:-

$('#dob').datepicker({
   calendarWeeks: true,
   todayHighlight: true,
   autoclose: true,
   format: 'dd-mm-yyyy'
});

Please let me know the configuration which will help me out.

Upvotes: 3

Views: 2449

Answers (1)

Praveen Kumar Guntoju
Praveen Kumar Guntoju

Reputation: 84

Add startView: 2 in the configuration

$('#dob').datepicker({
    calendarWeeks: true,
    todayHighlight: true,
    autoclose: true,
    format: 'dd-mm-yyyy',
    startView: 2
});

Upvotes: 5

Related Questions