user2310209
user2310209

Reputation: 1002

Jquery datepicker year range not working properly

I am using jquery datepicker.I have given date range from 1964 to 1990 . But without selecting year it takes current year such as 2013.What is the problem in jquery datepicker.I have enclosed coding here.

  jQuery(function(){

    jQuery('.driver_dob').datepicker({
      dateFormat: 'dd-mm-yy',
      changeMonth: true,
      changeYear: true,
      yearRange:  '1964:1991'
    });
});

Upvotes: 2

Views: 6535

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100205

you could add defaultDate, like

jQuery('.driver_dob').datepicker({
      dateFormat: 'dd-mm-yy',
      changeMonth: true,
      changeYear: true,
      yearRange:  '1964:1991',
      defaultDate: '01-01-1964'
});

Demo:: jsFiddle

Upvotes: 4

Related Questions