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

This commit is contained in:
Luck 2019-12-31 18:04:03 +00:00
parent 83883aa7e6
commit a33f326cfc
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -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));
}
}
}