Open rdesantis opened 4 years ago
Semantics:
If the word NOW appears in the FROM or UNTIL clause, TODAY is implied. This handles cases like EVERY 5 MINUTES FROM NOW UNTIL 2 HOURS LATER or EVERY 5 MINUTES UNTIL 2 HOURS FROM NOW.
Otherwise, EVERY DAY is implied. Thus, EVERY 5 MINUTES means EVERY DAY EVERY 5 MINUTES.
Support variations that omit date information like the following:
EVERY 5 MINUTES
The above resolves to EVERY DAY EVERY 5 MINUTES
As another example:
EVERY 5 MINUTES FROM NOW UNTIL 2 HOURS FROM NOW
The above correctly handles wrap around past midnight. How it resolves depends on the current time of day. For example, if the current time is 11:00 AM, it resolves to:
TODAY EVERY 5 MINUTES FROM 11:00 AM UNTIL 1:00 PM
However, if the current time is 11:00 PM, it resolves to:
TODAY EVERY 5 MINUTES FROM 11:00 PM, 1 DAY FROM TODAY EVERY 5 MINUTES UNTIL 1:00 AM
On the other hand, this:
EVERY 5 MINUTES FROM NOW UNTIL 72 HOURS FROM NOW
...resolves to:
TODAY EVERY 5 MINUTES FROM 11:00 PM, 1 DAY FROM TODAY UNTIL 2 DAYS FROM TODAY EVERY 5 MINUTES, 3 DAYS FROM TODAY EVERY 5 MINUTES UNTIL 1:00 AM