Skip to content

Commit a018a56

Browse files
Bug with parsing time by separator
1 parent b7c14ce commit a018a56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ $.extend(Timepicker.prototype, {
180180
// parse the time string from input value or _setTime
181181
//########################################################################
182182
_parseTime: function(timeString, withDate) {
183-
var regstr = this._defaults.separator + this._defaults.timeFormat.toString()
183+
var regstr = this._defaults.timeFormat.toString()
184184
.replace(/h{1,2}/ig, '(\\d?\\d)')
185185
.replace(/m{1,2}/ig, '(\\d?\\d)')
186186
.replace(/s{1,2}/ig, '(\\d?\\d)')
@@ -195,7 +195,7 @@ $.extend(Timepicker.prototype, {
195195
// the time should come after x number of characters and a space.
196196
// x = at least the length of text specified by the date format
197197
var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
198-
regstr = '.{' + dp_dateFormat.length + ',}\\s*' + regstr;
198+
regstr = '.{' + dp_dateFormat.length + ',}\\s*' + this._defaults.separator.replace(/\s/g, '\\s?') + regstr;
199199
}
200200

201201
treg = timeString.match(new RegExp(regstr, 'i'));

0 commit comments

Comments
 (0)