I have a model for timeframes defined by:
STARTTIME: HH:MM
ENDTIME: HH:MM
Now i need to do a query with a given time ACTUALTIME in the format HH:MM, and check whether ACTUALTIME is within the any of my given Timeframes defined by: STARTTIME and ENDTIME.
Since the Ruby time object when defined only by the Hour and Minute is always represented by a date, i wonder wether there is any possibility to query something like:
Is 13:40 between 11:00 and 15:00 without taking the date part into account.
Thank Phrogz advice I figured out how to write a method which can compare two times independent from their date. It works fine for me even when the
ENDTIMEis after 24:00