Please suggest if there is API support to determine if my time is between 2 LocalTime instances or suggest a different approach.
I have this object:
class Place { LocalTime startDay; LocalTime endDay; }
which stores the start and end time of the working day, that is, from 9:00 to 17:00 or a night club from 22:00 to 5:00.
I need to implement the Place.isOpen() method, which determines whether a place is currently open.
The simple isBefore / isAfter does not work here, because we also need to determine if there will be an end time the next day.
Of course, we can compare the start and end times and make a decision, but I want something without additional logic, just a simple call between() . If LocalTime not enough for this purpose, suggest another.
source share