Skip to content

Commit ec7678e

Browse files
Fixed setting options, setDate
1 parent 3a6666b commit ec7678e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,12 @@ $.fn.extend({
460460
// shorthand just to use timepicker..
461461
//########################################################################
462462
timepicker: function(o) {
463+
var tmp_args = arguments;
464+
463465
if (typeof o == 'object') o = $.extend(o, { timeOnly: true });
466+
464467
return this.each(function() {
465-
$(this).datetimepicker(o, arguments[1], arguments[2], arguments[3], arguments[4]);
468+
$(this).datetimepicker(o, tmp_args[1], tmp_args[2], tmp_args[3], tmp_args[4]);
466469
});
467470
},
468471

@@ -471,17 +474,18 @@ $.fn.extend({
471474
//########################################################################
472475
datetimepicker: function(o) {
473476
o = o || {};
474-
var $input = this;
477+
var $input = this,
478+
tmp_args = arguments;
475479

476480
if (typeof(o) == 'string') {
477481
if (o == 'setDate') return this.each(function() {
478-
$(this).datepicker(o, arguments[1]);
482+
$(this).datepicker(o, tmp_args[1]);
479483
});
480-
else if(o == 'option' && typeof(arguments[1]) == 'string') return this.each(function() {
481-
$(this).datepicker(o, arguments[1], arguments[2]);
484+
else if(o == 'option' && typeof(tmp_args[1]) == 'string') return this.each(function() {
485+
$(this).datepicker(o, tmp_args[1], tmp_args[2]);
482486
});
483487
else if(o == 'dialog') return this.each(function() {
484-
$(this).datepicker(o, arguments[1], arguments[2], arguments[3], arguments[4]);
488+
$(this).datepicker(o, tmp_args[1], tmp_args[2], tmp_args[3], tmp_args[4]);
485489
});
486490
else return this.each(function() {
487491
$(this).datepicker(o);

0 commit comments

Comments
 (0)