diff options
author | David Petersen <public@petersendidit.com> | 2013-01-23 11:50:00 -0800 |
---|---|---|
committer | David Petersen <public@petersendidit.com> | 2013-01-23 11:50:00 -0800 |
commit | f7f165c9f8281c5fc5d060eb7bfe09921a0aea82 (patch) | |
tree | 69538b346edec352b07bd123ea2e023eb6749a0c /tests | |
parent | 10c873ab6cf2333f7e51784e84c03a0fbb975e1f (diff) | |
parent | 8f7c3e309cae07c75b930c55f14c05053d5028e9 (diff) | |
download | jquery-ui-f7f165c9f8281c5fc5d060eb7bfe09921a0aea82.tar.gz jquery-ui-f7f165c9f8281c5fc5d060eb7bfe09921a0aea82.zip |
Merge pull request #891 from petersendidit/datepicker_8994
Datepicker: Handle when yearRange is a year or a modifier. Fixed #8994 -...
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/datepicker/datepicker_options.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index e47235786..dac2262dc 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -384,7 +384,7 @@ test("miscellaneous", function() { }); test("minMax", function() { - expect( 19 ); + expect( 23 ); var date, inp = TestHelpers.datepicker.init("#inp"), dp = $("#ui-datepicker-div"), @@ -472,6 +472,22 @@ test("minMax", function() { ok(dp.find(".ui-datepicker-prev").hasClass("ui-state-disabled"), "Year Range Test - previous button disabled at 1/1/minYear"); inp.datepicker("setDate", "12/30/" + new Date().getFullYear()); ok(dp.find(".ui-datepicker-next").hasClass("ui-state-disabled"), "Year Range Test - next button disabled at 12/30/maxYear"); + + inp.datepicker("option", { + minDate: new Date(1900, 0, 1), + maxDate: "-6Y", + yearRange: "1900:-6" + }).val( "" ); + ok(dp.find(".ui-datepicker-next").hasClass("ui-state-disabled"), "Year Range Test - next button disabled"); + ok(!dp.find(".ui-datepicker-prev").hasClass("ui-state-disabled"), "Year Range Test - prev button enabled"); + + inp.datepicker("option", { + minDate: new Date(1900, 0, 1), + maxDate: "1/25/2007", + yearRange: "1900:2007" + }).val( "" ); + ok(dp.find(".ui-datepicker-next").hasClass("ui-state-disabled"), "Year Range Test - next button disabled"); + ok(!dp.find(".ui-datepicker-prev").hasClass("ui-state-disabled"), "Year Range Test - prev button enabled"); }); test("setDate", function() { |