Skip to content

Commit 4f68f66

Browse files
committed
fix $toMillis() with more than 3 digit fractional seconds
Backport of jsonata-js/jsonata#782
1 parent fbb6878 commit 4f68f66

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/main/java/com/dashjoin/jsonata/utils/DateTimeUtils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,13 @@ public int parse(String value) {
11071107
return offsetHours * 60 + offsetMinutes;
11081108
}
11091109
};
1110+
} else if (part.component == 'f') {
1111+
res = new MatcherPart("[0-9]+") {
1112+
public int parse(String value) {
1113+
// return parseFloat('0.' + value.substring(0, 3)) * 1000;
1114+
return Integer.parseInt(value.substring(0,3));
1115+
}
1116+
};
11101117
} else if (part.integerFormat != null) {
11111118
res = generateRegex(part.component,part.integerFormat);
11121119
} else {

0 commit comments

Comments
 (0)