|
|
|
@ -230,9 +230,7 @@ abstract class CronField {
@@ -230,9 +230,7 @@ abstract class CronField {
|
|
|
|
|
* Elapse the given temporal for the difference between the current |
|
|
|
|
* value of this field and the goal value. Typically, the returned |
|
|
|
|
* temporal will have the given goal as the current value for this type, |
|
|
|
|
* but this is not the case for {@link #DAY_OF_MONTH}. For instance, |
|
|
|
|
* if {@code goal} is 31, and {@code temporal} is April 16th, |
|
|
|
|
* this method returns May 1st, because April 31st does not exist. |
|
|
|
|
* but this is not the case for {@link #DAY_OF_MONTH}. |
|
|
|
|
* @param temporal the temporal to elapse |
|
|
|
|
* @param goal the goal value |
|
|
|
|
* @param <T> the type of temporal |
|
|
|
@ -247,8 +245,9 @@ abstract class CronField {
@@ -247,8 +245,9 @@ abstract class CronField {
|
|
|
|
|
return cast(temporal.with(this.field, goal)); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// goal is invalid, eg. 29th Feb, lets try to get as close as possible
|
|
|
|
|
return this.field.getBaseUnit().addTo(temporal, goal - current); |
|
|
|
|
// goal is invalid, eg. 29th Feb, so roll forward
|
|
|
|
|
long amount = range.getMaximum() - current + 1; |
|
|
|
|
return this.field.getBaseUnit().addTo(temporal, amount); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|