[Remind-Fans] move reminder if Monday is a holiday

Ian! D. Allen idallen at idallen.ca
Mon Oct 14 05:46:40 EDT 2019


I didn't see this situation in the examples/defs.rem file, and maybe it
could be tidied up and included if others think it useful:

Garbage Day is on Thursday every two weeks, and I have a reminder the
day before:

    REM Oct  9 2019 ++5 *14 AT 22:00 MSG Put Out Garbage
    REM Oct 10 2019 ++5 *14 MSG Garbage Day

But in weeks with a Monday holiday (global OMIT), Garbage Day moves
to Friday and my "Put Out Garbage" moves to a Thursday.  How do I make
remind do that elegantly?  This seems to work:

    FSET _o2(x) (isomitted(x-2))
    FSET _o3(x) (isomitted(x-3))

    REM Oct  9 2019 ++5 *14 AT 22:00 OMITFUNC _o2 AFTER MSG Put Out Garbage
    REM Oct 10 2019 ++5 *14 OMITFUNC _o3 AFTER MSG Garbage Day

It doesn't seem elegant since I need two functions that are hard-coded
to to know that Monday is either two or three days previous and each
function would have to be changed if Garbage Day moved to, say, Thursdays.

Is there a nice way to make one function that checks the holiday status of
"the Monday preceding the current date"?  I tried using wkdaynum() and
some arithmetic in there without any success.

-- 
| Ian! D. Allen, BA, MMath  -  idallen at idallen.ca - Ottawa, Ontario, Canada
| Home: www.idallen.com   Contact Improvisation Dance: www.contactimprov.ca
| Former college professor (Free/Libre GNU+Linux) at:  teaching.idallen.com
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/


More information about the Remind-fans mailing list