[Remind-Fans] sat->fri and sun->mon

Dianne Skoll dianne at skoll.ca
Thu Feb 3 20:28:46 EST 2022


On Thu, 03 Feb 2022 20:03:58 -0500
Hymie! via Remind-fans <remind-fans at lists.skoll.ca> wrote:

> I'm familiar with the BEFORE and AFTER keywords ... but I wonder if
> it would be hard to add a single keyword for "Move Saturday to Friday
> and Move Sunday to Monday" for things like Veterans Day.

A little bit hard, yes, because of how the Remind algorithm works.  Mixing
BEFORE and AFTER might get tricky.  Probably doable, but the
weekend is not Saturday and Sunday everywhere, so it wouldn't be
very general.

But if you want a more concise, but less efficient and less readable
version of your Veteran's Day example...

REM Nov SCANFROM -7 SATISFY [($Td == 10 && $Tw == 5) || \
                  ($Td == 12 && $Tw == 1) || \
                  ($Td == 11 && $Tw >= 1 && $Tw <= 5)] MSG Veteran's Day
OMIT [$T]

Decoding the expression, it accepts:  The 10th if it's a Friday; the
12th if it's a Monday, or the 11th if it's a Monday through Friday.

Regards,

Dianne.

PS: Modern versions of Remind let you say:  SCANFROM -7 instead of
SCANFROM [trigger(today()-7)]


More information about the Remind-fans mailing list