summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoublerebel <charles@doublerebel.com>2010-11-20 18:46:20 -0800
committerdoublerebel <charles@doublerebel.com>2010-11-20 18:46:20 -0800
commitbadcc050c44872d30d23a1fa5c8e3a75c0981f74 (patch)
tree25f708563b8d25d49f17900b5bd8eb0a845023e4
parent425b957de02772824b97572cad37cc223dff8f6a (diff)
downloadjQuery-Timepicker-Addon-badcc050c44872d30d23a1fa5c8e3a75c0981f74.zip
jQuery-Timepicker-Addon-badcc050c44872d30d23a1fa5c8e3a75c0981f74.tar.gz
jQuery-Timepicker-Addon-badcc050c44872d30d23a1fa5c8e3a75c0981f74.tar.bz2
Fixed ampm constraint
-rw-r--r--jquery-ui-timepicker-addon.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 1263f0f..01413ba 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -608,10 +608,13 @@ $.datepicker._doKeyPress = function(event) {
if (tp_inst) {
if ($.datepicker._get(inst, 'constrainInput')) {
- var datetimeChars = tp_inst._defaults.timeFormat.toString()
+ var ampm = tp_inst._defaults.ampm,
+ datetimeChars = tp_inst._defaults.timeFormat.toString()
.replace(/[hms]/g, '')
- .replace(/TT|T/g, tp_inst._defaults.ampm ? 'APM' : '')
- .replace(/tt|t/g, tp_inst._defaults.ampm ? 'apm' : '') +
+ .replace(/TT/g, ampm ? 'APM' : '')
+ .replace(/T/g, ampm ? 'AP' : '')
+ .replace(/tt/g, ampm ? 'apm' : '')
+ .replace(/t/g, ampm ? 'ap' : '') +
" " +
$.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);