From b2a1d9440a54d0e864160d9010d327f4cf7b41bf Mon Sep 17 00:00:00 2001 From: kumm Date: Sun, 23 Jan 2011 12:35:49 +0100 Subject: [PATCH] fix default hour,minute,second by changing init order --- jquery-ui-timepicker-addon.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 4f32e5b..6ebb5ae 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -107,14 +107,7 @@ $.extend(Timepicker.prototype, { _newInst: function($input, o) { var tp_inst = new Timepicker(), inlineSettings = {}; - - tp_inst.hour = tp_inst._defaults.hour; - tp_inst.minute = tp_inst._defaults.minute; - tp_inst.second = tp_inst._defaults.second; - tp_inst.ampm = ''; - tp_inst.$input = $input; - for (var attrName in this._defaults) { var attrValue = $input.attr('time:' + attrName); if (attrValue) { @@ -145,6 +138,12 @@ $.extend(Timepicker.prototype, { timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); }); + tp_inst.hour = tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second; + tp_inst.ampm = ''; + tp_inst.$input = $input; + if (o.altField) tp_inst.$altInput = $(o.altField) .css({ cursor: 'pointer' })