Skip to content

Commit 3fd0508

Browse files
Improve parsing flexibility
1 parent 6f22271 commit 3fd0508

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,9 @@
10391039
.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
10401040
var ml = match.length;
10411041
switch (match.charAt(0).toLowerCase()) {
1042-
case 'h': return ml === 1? '(\\d?\\d)':'(\\d\\d)';
1043-
case 'm': return ml === 1? '(\\d?\\d)':'(\\d\\d)';
1044-
case 's': return ml === 1? '(\\d?\\d)':'(\\d\\d)';
1042+
case 'h': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
1043+
case 'm': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
1044+
case 's': return ml === 1? '(\\d?\\d)':'(\\d{'+ml+'})';
10451045
case 'l': return '(\\d?\\d?\\d)';
10461046
case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
10471047
case 't': return getPatternAmpm(o.amNames, o.pmNames);

0 commit comments

Comments
 (0)