From c6f5819f138384c77276e54c00fefffc53c315e6 Mon Sep 17 00:00:00 2001 From: Trent Richardson Date: Fri, 17 Dec 2010 10:58:58 -0500 Subject: [PATCH] Add separator to allowed key press, clean up --- jquery-ui-timepicker-addon.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 345c728..2b3d3a1 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -208,7 +208,8 @@ $.extend(Timepicker.prototype, { return true; - } else return false; + } + return false; }, //######################################################################## @@ -611,8 +612,7 @@ $.extend(Timepicker.prototype, { } else if(this.$altInput) { this.$altInput.val(formattedDateTime); this.$input.val(formattedDateTime); - } - else{ + } else { this.$input.val(formattedDateTime); } @@ -715,12 +715,14 @@ $.datepicker._doKeyPress = function(event) { .replace(/tt/g, ampm ? 'apm' : '') .replace(/t/g, ampm ? 'ap' : '') + " " + + tp_inst._defaults.separator + $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')), chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode); return event.ctrlKey || (chr < ' ' || !datetimeChars || datetimeChars.indexOf(chr) > -1); } - } else return $.datepicker._base_doKeyPress(event); - + } + + return $.datepicker._base_doKeyPress(event); }; //####################################################################################### @@ -836,7 +838,7 @@ $.datepicker._getDateDatepicker = function(target, noDefault) { if (date && tp_inst._parseTime($(target).val(), true)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second); return date; } - else return this._base_getDateDatepicker(target, noDefault); + return this._base_getDateDatepicker(target, noDefault); }; //#######################################################################################