Skip to content

Commit c6f5819

Browse files
Add separator to allowed key press, clean up
1 parent c851cef commit c6f5819

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ $.extend(Timepicker.prototype, {
208208

209209
return true;
210210

211-
} else return false;
211+
}
212+
return false;
212213
},
213214

214215
//########################################################################
@@ -611,8 +612,7 @@ $.extend(Timepicker.prototype, {
611612
} else if(this.$altInput) {
612613
this.$altInput.val(formattedDateTime);
613614
this.$input.val(formattedDateTime);
614-
}
615-
else{
615+
} else {
616616
this.$input.val(formattedDateTime);
617617
}
618618

@@ -715,12 +715,14 @@ $.datepicker._doKeyPress = function(event) {
715715
.replace(/tt/g, ampm ? 'apm' : '')
716716
.replace(/t/g, ampm ? 'ap' : '') +
717717
" " +
718+
tp_inst._defaults.separator +
718719
$.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
719720
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
720721
return event.ctrlKey || (chr < ' ' || !datetimeChars || datetimeChars.indexOf(chr) > -1);
721722
}
722-
} else return $.datepicker._base_doKeyPress(event);
723-
723+
}
724+
725+
return $.datepicker._base_doKeyPress(event);
724726
};
725727

726728
//#######################################################################################
@@ -836,7 +838,7 @@ $.datepicker._getDateDatepicker = function(target, noDefault) {
836838
if (date && tp_inst._parseTime($(target).val(), true)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second);
837839
return date;
838840
}
839-
else return this._base_getDateDatepicker(target, noDefault);
841+
return this._base_getDateDatepicker(target, noDefault);
840842
};
841843

842844
//#######################################################################################

0 commit comments

Comments
 (0)