From 88a0b943bc2e72e5896b8bdae49263376ac089d6 Mon Sep 17 00:00:00 2001 From: Trent Richardson Date: Thu, 18 Nov 2010 16:58:02 -0500 Subject: [PATCH] Corrected methods --- 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 0d2718f..3f591bf 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -529,8 +529,8 @@ $.fn.extend({ if (typeof o == 'object') tmp_args[0] = $.extend(o, { timeOnly: true }); - return this.each(function() { - $.fn.datepicker.apply(this, tmp_args); + return $(this).each(function() { + $.fn.datetimepicker.apply($(this), tmp_args); }); }, @@ -542,10 +542,14 @@ $.fn.extend({ var $input = this, tmp_args = arguments; - if (typeof(o) == 'string') - return this.each(function() { - $.fn.datepicker.apply(this, tmp_args); - }); + if (typeof(o) == 'string'){ + if(o == 'getDate') + return $.fn.datepicker.apply($(this), tmp_args); + else + return this.each(function() { + $.fn.datepicker.apply($(this), tmp_args); + }); + } else return this.each(function() { $(this).datepicker($.timepicker._newInst($input, o)._defaults);