File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1025,8 +1025,12 @@ const dateTime = (function () {
1025
1025
return res ;
1026
1026
} ) ;
1027
1027
} else { // type === 'integer'
1028
+ // MYTODO
1029
+ // It seems that _formatInteger accounts for mandatoryDigits but here it does not
1030
+ // Note, syntax based on https://www.w3.org/TR/xpath-functions-31/#date-time-examples
1028
1031
matcher . type = 'integer' ;
1029
1032
const isUpper = formatSpec . case === tcase . UPPER ;
1033
+ const mandatoryDigits = formatSpec . mandatoryDigits && formatSpec . mandatoryDigits > 0 ? formatSpec . mandatoryDigits . toString ( ) : '+' ;
1030
1034
switch ( formatSpec . primary ) {
1031
1035
case formats . LETTERS :
1032
1036
matcher . regex = isUpper ? '[A-Z]+' : '[a-z]+' ;
@@ -1047,7 +1051,7 @@ const dateTime = (function () {
1047
1051
} ;
1048
1052
break ;
1049
1053
case formats . DECIMAL :
1050
- matcher . regex = ' [0-9]+' ;
1054
+ matcher . regex = ` [0-9]{ ${ mandatoryDigits } }` ;
1051
1055
if ( formatSpec . ordinal ) {
1052
1056
// ordinals
1053
1057
matcher . regex += '(?:th|st|nd|rd)' ;
You can’t perform that action at this time.
0 commit comments