mirror of
https://github.com/frode-carlsen/cron.git
synced 2025-12-06 14:00:57 +03:00
Updated method name - add support for taking in LocalDateTime
This commit is contained in:
@@ -20,6 +20,7 @@ package fc.cron;
|
|||||||
import java.time.DayOfWeek;
|
import java.time.DayOfWeek;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -311,8 +312,8 @@ public class CronExpression {
|
|||||||
return nextTimeAfter(afterTime, afterTime.plusYears(4));
|
return nextTimeAfter(afterTime, afterTime.plusYears(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDateTime neste(LocalDateTime forrige) {
|
public LocalDateTime nextLocalDateTimeAfter(LocalDateTime dateTime) {
|
||||||
return nextTimeAfter(ZonedDateTime.of(forrige, ZoneId.systemDefault())).toLocalDateTime();
|
return nextTimeAfter(ZonedDateTime.of(dateTime, ZoneId.systemDefault())).toLocalDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) {
|
public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) {
|
||||||
|
|||||||
Reference in New Issue
Block a user