summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoublerebel <charles@doublerebel.com>2010-11-20 17:40:24 -0800
committerdoublerebel <charles@doublerebel.com>2010-11-20 18:44:25 -0800
commit425b957de02772824b97572cad37cc223dff8f6a (patch)
tree14ba0b8fd00b40df9d4ebccab1b3df1477d5675e
parent95a6ef2f4451a395ef6bf1df4f90e2f16dea811f (diff)
downloadjQuery-Timepicker-Addon-425b957de02772824b97572cad37cc223dff8f6a.zip
jQuery-Timepicker-Addon-425b957de02772824b97572cad37cc223dff8f6a.tar.gz
jQuery-Timepicker-Addon-425b957de02772824b97572cad37cc223dff8f6a.tar.bz2
Check if ampm is enabled when constraining input
-rw-r--r--jquery-ui-timepicker-addon.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 75f0825..1263f0f 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -610,8 +610,8 @@ $.datepicker._doKeyPress = function(event) {
if ($.datepicker._get(inst, 'constrainInput')) {
var datetimeChars = tp_inst._defaults.timeFormat.toString()
.replace(/[hms]/g, '')
- .replace(/TT|T/g, 'APM')
- .replace(/tt|t/g, 'apm') +
+ .replace(/TT|T/g, tp_inst._defaults.ampm ? 'APM' : '')
+ .replace(/tt|t/g, tp_inst._defaults.ampm ? 'apm' : '') +
" " +
$.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);