[Remind-Fans] Multi-day events based off a calculated date?

Tim Chase tim at thechases.com
Thu Sep 27 10:43:18 EDT 2018


On 2018-09-26 22:35, Dianne Skoll wrote:
> Tim Chase <remind at tim.thechases.com> wrote:
> 
> > I'm trying to figure out how to specify "the first weekend of each
> > month" (defined as the first Saturday of the month and the Sunday
> > that follows it).  
> 
> The trick is to realize the following equivalence:
> 
> "The Sunday after the first Saturday in a month"  is exactly the
> same as: "The Sunday on or after the 2nd of the month"

After sufficient banging my head against it, I came a similar
solution shortly before your reply arrived:

REM Sat Sun 2019 +1 UNTIL Jan 1 2020 SATISFY [ \
    ($Tw  == 6 && $Td < 8) \
    || ($Tw == 0 && $Td > 1 && $Td < 9) \
    ] MSG %"Weekend to work%" %b%

(the UNTIL is there since I only have the work schedule for 2019,
subject to change beyond that).

> Spend a bit of time to convince yourself of that equivalence...

It took a bunch of shell-scripting tests for various dates to make
sure I had all the weird edge cases, but this was just what I
needed.

(SATISFY is a great swiss-army-knife for whacking problems in a way
that fits my mind.)

Thanks!

-tim





More information about the Remind-fans mailing list