Class DateTimeUtils
java.lang.Object
energy.eddie.regionconnector.shared.utils.DateTimeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic ZonedDateTimestatic booleanisBeforeOrEquals(LocalDate left, LocalDate right) Checks if left is before or equal to right.static Optional<ZonedDateTime> oldestDateTime(Collection<ZonedDateTime> dateTimes) Finds the oldest date time in a collection of data times.
-
Method Details
-
endOfDay
-
oldestDateTime
Finds the oldest date time in a collection of data times. If the collection is empty or only contains null values, returns an empty optional.- Parameters:
dateTimes- the collection of date times- Returns:
- the oldest datetime or empty optional if the collection is empty, or filled with null values.
-
isBeforeOrEquals
Checks if left is before or equal to right. Read asleft <= right- Parameters:
left- left-hand operandright- right-hand operand- Returns:
- true if left is before or equals to right, otherwise false
-