A small method to check if a LocalDataTime is in a Range between to other LocalDateTime - Objects.
private boolean isInDateRange( LocalDateTime upper, LocalDateTime lower, LocalDateTime toCheck) { var isUpper = toCheck.equals(upper); var isLower = toCheck.equals(lower); if (isLower || isUpper) { return true; } return toCheck.isBefore(upper) && toCheck.isAfter(lower); }
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3