aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker/datepicker_options.js
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2009-06-21 07:28:51 +0000
committerKeith Wood <kbwood.au@gmail.com>2009-06-21 07:28:51 +0000
commit3b5c91fdc668bd02cfb0293cf167f05a5c5b4b86 (patch)
tree1c0730894087b648203750643e0f2cf01e6cdbaa /tests/unit/datepicker/datepicker_options.js
parent82df8dbf533f2b44602e33c4201d7fe8475be919 (diff)
downloadjquery-ui-3b5c91fdc668bd02cfb0293cf167f05a5c5b4b86.tar.gz
jquery-ui-3b5c91fdc668bd02cfb0293cf167f05a5c5b4b86.zip
Datepicker. Fixed #3657 showOtherMonths should allow the selection of days from other months
Diffstat (limited to 'tests/unit/datepicker/datepicker_options.js')
-rw-r--r--tests/unit/datepicker/datepicker_options.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 8bde84473..0a111a93c 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -136,6 +136,27 @@ test('invocation', function() {
inp.datepicker('hide').datepicker('destroy');
});
+test('otherMonths', function() {
+ var inp = init('#inp');
+ var pop = $('#ui-datepicker-div');
+ inp.val('06/01/2009').datepicker('show');
+ equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
+ 'Other months - none');
+ ok(pop.find('td:last *').length == 0, 'Other months - no content');
+ inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show');
+ equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234',
+ 'Other months - show');
+ ok(pop.find('td:last span').length == 1, 'Other months - span content');
+ inp.datepicker('hide').datepicker('option', 'selectOtherMonths', true).datepicker('show');
+ equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234',
+ 'Other months - select');
+ ok(pop.find('td:last a').length == 1, 'Other months - link content');
+ inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show');
+ equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
+ 'Other months - none');
+ ok(pop.find('td:last *').length == 0, 'Other months - no content');
+});
+
test('defaultDate', function() {
var inp = init('#inp');
var date = new Date();