Fix duration parser handling of weeks, months & years (#1905)

This commit is contained in:
Luck committed 2019-12-31 18:04:03 +00:00
1 parent 83883aa7e6
commit a33f326cfc
1 file changed
+3 -1
@@ -73,7 +73,9 @@ public final class DurationParser {
if (matcher.group(g) != null && !matcher.group(g).isEmpty()) {
int n = Integer.parseInt(matcher.group(g));
duration = duration.plus(n, unit);
if (n > 0) {
duration = duration.plus(unit.getDuration().multipliedBy(n));
}
}
}