[Remind-Fans] Overdue items (cont.)
morel_rf at armory.com
morel_rf at armory.com
Tue Dec 9 16:44:09 EST 2014
On Tue, Dec 09, 2014 at 08:50:02AM -0400, Scott Hatcher wrote:
> In my search to produce a trigger on my reminders that mirror the
> upcoming substitutions (%b, "in 2 days"), but for overdue items (%d,
> "due 2 days ago"), I came across this list post:
>
> http://lists.roaringpenguin.com/pipermail/remind-fans/2005/000449.html
For such situations, and to play around with reminder phrasing,
I use wrapper functions (in a separate included file):
FSET _dayinterval(date,phrasing) iif(\
((date-today()) < -1),\
abs(date-today()) + " day" + plural(date-today()) + " ago",\
((date-today()) == -1),\
"yesterday",\
((date-today()) == 1),\
"tomorrow",\
((date-today()) > 1),\
iif(phrasing == "indaystime", "in ","") + \
(date-today()) + \
iif(phrasing == "indaystime", " days' time", \
phrasing == "daysfromnow", " days from now", ""),\
"today")
FSET _ago(date) _dayinterval(date,"indaystime")
FSET _date(date) dosubst("%w, %m %d%s%",date) + " (" + _ago(date) + ")"
FSET _wfun(x) choose(x, 21, 14, 7, 3, 2, 1, 0)
# The reminder - it nags until the rent_due date is revised to next month's:
SET rent_due '2014-12-12'
IF today() <= rent_due
REM [trigger(rent_due)] WARN _wfun \
MSG Rent is due [_date(rent_due)]
ELSE
MSG Rent was due [_date(rent_due)] !!!
ENDIF
Tony
More information about the Remind-fans
mailing list