Opened 11 years ago

Closed 10 years ago

#7631 closed bug (duplicate)

datepicker does not honor yearRange

Reported by: gor Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.15
Keywords: Cc:
Blocked by: Blocking:


The datepicker with specified yearRange misbehaves.

  1. Specify yearRange 1900-2012
  2. Open datepicker
  3. Click next month button, until year becames 1900 (after overflow)
  4. Choose any date in 1900 year
  5. Selected date is in 2013 year

Here is a unit test, than could be added to test suite:

(function($) {
    module("datepicker: gor");
    test('gor-test', function() {
        var inp = init('#inp', {yearRange: '1900:2010', changeYear: true});
        var dp = $('#ui-datepicker-div');


        var next = $('a.ui-datepicker-next', dp);

        //press next button 12 times.
        //this should change year to 1900
        for (var i = 0; i <12; i++){
        $('.ui-datepicker-calendar a:contains(10)').click()
        equals($('select.ui-datepicker-year', dp).val(), "1900");

        var date = inp.datepicker('getDate');
        equal(date.getFullYear(), 1900);

Change History (2)

comment:1 Changed 10 years ago by Scott González


comment:2 Changed 10 years ago by mikesherov

Resolution: duplicate
Status: newclosed

Duplicate of #7362.

Note: See TracTickets for help on using tickets.