From ec7678e567fecd613849dc579defb5ceb5c64d9e Mon Sep 17 00:00:00 2001 From: Trent Richardson Date: Tue, 16 Nov 2010 11:35:30 -0500 Subject: [PATCH] Fixed setting options, setDate --- jquery-ui-timepicker-addon.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 8e482c3..1c67897 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -460,9 +460,12 @@ $.fn.extend({ // shorthand just to use timepicker.. //######################################################################## timepicker: function(o) { + var tmp_args = arguments; + if (typeof o == 'object') o = $.extend(o, { timeOnly: true }); + return this.each(function() { - $(this).datetimepicker(o, arguments[1], arguments[2], arguments[3], arguments[4]); + $(this).datetimepicker(o, tmp_args[1], tmp_args[2], tmp_args[3], tmp_args[4]); }); }, @@ -471,17 +474,18 @@ $.fn.extend({ //######################################################################## datetimepicker: function(o) { o = o || {}; - var $input = this; + var $input = this, + tmp_args = arguments; if (typeof(o) == 'string') { if (o == 'setDate') return this.each(function() { - $(this).datepicker(o, arguments[1]); + $(this).datepicker(o, tmp_args[1]); }); - else if(o == 'option' && typeof(arguments[1]) == 'string') return this.each(function() { - $(this).datepicker(o, arguments[1], arguments[2]); + else if(o == 'option' && typeof(tmp_args[1]) == 'string') return this.each(function() { + $(this).datepicker(o, tmp_args[1], tmp_args[2]); }); else if(o == 'dialog') return this.each(function() { - $(this).datepicker(o, arguments[1], arguments[2], arguments[3], arguments[4]); + $(this).datepicker(o, tmp_args[1], tmp_args[2], tmp_args[3], tmp_args[4]); }); else return this.each(function() { $(this).datepicker(o);