I want to write a boolean valued function which returns true if the given LocalDateTime
falls between two specific points in time, false otherwise.
Specific
How would you expect such a library to work? You would still need to tell it when your weekend begins and ends and it would end up being not much shorter than the simple
boolean isWeekend(LocalDateTime dt) {
switch(dt.getDayOfWeek()) {
case FRIDAY:
return dt.getHour() >= ...;
case SATURDAY:
return true;
case SUNDAY:
return dt.getHour() < ...;
default:
return false;
}
}