aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/datepicker/datepicker_tickets.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_tickets.js b/tests/unit/datepicker/datepicker_tickets.js
index 10647eb13..353426625 100644
--- a/tests/unit/datepicker/datepicker_tickets.js
+++ b/tests/unit/datepicker/datepicker_tickets.js
@@ -24,6 +24,39 @@ test('beforeShowDay-getDate', function() {
inp.datepicker('hide');
});
+test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
+ var inp = init('#inp',{
+ beforeShow: function(){
+ return false;
+ }
+ });
+ var dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equals(dp.css('display'), 'none',"beforeShow returns false");
+ inp.datepicker('destroy');
+
+ inp = init('#inp',{
+ beforeShow: function(){
+ }
+ });
+ dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equal(dp.css('display'), 'block',"beforeShow returns nothing");
+ inp.datepicker('hide');
+ inp.datepicker('destroy');
+
+ inp = init('#inp',{
+ beforeShow: function(){
+ return true;
+ }
+ });
+ dp = $('#ui-datepicker-div');
+ inp.datepicker('show');
+ equal(dp.css('display'), 'block',"beforeShow returns true");
+ inp.datepicker('hide');
+ inp.datepicker('destroy');
+});
+
test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
equals(time, "089");