equal
deleted
inserted
replaced
111 |
111 |
112 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; |
112 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; |
113 |
113 |
114 local function current_time_check(op, hour, minute) |
114 local function current_time_check(op, hour, minute) |
115 hour, minute = tonumber(hour), tonumber(minute); |
115 hour, minute = tonumber(hour), tonumber(minute); |
116 local s = ""; |
|
117 local adj_op = op == "<" and "<" or ">="; -- Start time inclusive, end time exclusive |
116 local adj_op = op == "<" and "<" or ">="; -- Start time inclusive, end time exclusive |
118 if minute == 0 then |
117 if minute == 0 then |
119 return "(current_hour"..adj_op..hour..")"; |
118 return "(current_hour"..adj_op..hour..")"; |
120 else |
119 else |
121 return "((current_hour"..op..hour..") or (current_hour == "..hour.." and current_minute"..adj_op..minute.."))"; |
120 return "((current_hour"..op..hour..") or (current_hour == "..hour.." and current_minute"..adj_op..minute.."))"; |