A third(3)dot will exclude the starttime from the number range
example:
starttime = 1100
stoptime = 0800
(stoptime...starttime)
openhours will now turn true on 1100 not 1101 in previous examples.
A third(3)dot in the open time range (starttime...stoptime) will also see a stoptime(2330) turn openhours false on 2330 not 2331
Code: Select all
Tz = +11 # Time Zone GMT+11
t = Time.now.utc + (Tz*60*60)
hhmm = t.strftime("%H%M")
starttime = '0800' # 8:00am(0800) to
stoptime = '2330' # 11:30pm(2330) 24 hour time
openhours = stoptime < starttime ? !((stoptime...starttime) === hhmm) : (starttime...stoptime) === hhmm
if openhours then sys.Dial("#{sys.Username}@local")