Merge branch '5.3.x'
This commit is contained in:
commit
3463106532
|
@ -269,7 +269,14 @@ abstract class CronField {
|
|||
int current = get(temporal);
|
||||
ValueRange range = temporal.range(this.field);
|
||||
long amount = range.getMaximum() - current + 1;
|
||||
return this.field.getBaseUnit().addTo(temporal, amount);
|
||||
T result = this.field.getBaseUnit().addTo(temporal, amount);
|
||||
current = get(result);
|
||||
range = result.range(this.field);
|
||||
// adjust for daylight savings
|
||||
if (current != range.getMinimum()) {
|
||||
result = this.field.adjustInto(result, range.getMinimum());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1336,6 +1336,14 @@ class CronExpressionTests {
|
|||
actual = cronExpression.next(last);
|
||||
assertThat(actual).isNotNull();
|
||||
assertThat(actual).isEqualTo(expected);
|
||||
|
||||
cronExpression = CronExpression.parse("0 5 0 * * *");
|
||||
|
||||
last = ZonedDateTime.parse("2021-03-28T01:00:00+01:00[Europe/Amsterdam]");
|
||||
expected = ZonedDateTime.parse("2021-03-29T00:05+02:00[Europe/Amsterdam]");
|
||||
actual = cronExpression.next(last);
|
||||
assertThat(actual).isNotNull();
|
||||
assertThat(actual).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue