On Sun, 28 Sep 2025 16:59:48 +0200
TheBlackzone via Remind-fans <[email protected]> wrote:

> I’m trying to set up a reminder for three consecutive days:

> - The first Friday after November 1
> - The Saturday that follows that Friday
> - The Sunday that follows that Friday

> set ffn evaltrig("fri after nov 1")
> rem [ffn] msg First Friday after November 1st
> rem [ffn+1] msg First Saturday after first Friday after November 1st
> rem [ffn+2] msg First Sunday after first Friday after November 1st

Hand-calculating a trigger date is almost never correct.  It attempts
to short-circuit the Remind algorithm (described on the 12th slide of
https://dianne.skoll.ca/projects/remind/download/remind-oclug.pdf)
And hand-calculating a trigger date and then adding a constant to
it will almost certainly fail to work the way you want it.

What you want is something like this:

    # Return true if the date x is the first Friday of a month
    FSET is_first_friday(x) wkdaynum(x) == 5 && day(x) <= 7

    # Trigger on the first Friday in November, and the following two
days REM Nov SATISFY [is_first_friday($T) || is_first_friday($T-1) ||
is_first_friday($T-2)] MSG Hello!

The SATISFY expression is satisfied if today, yesterday, or the day
before yesterday was the first Friday of the month.

To see why *your* version doesn't work, run Remind with the "-dt" flag
and maybe also "-dx".  That should make everything clear.

You can fix up your version with a SCANFROM:

    set ffn evaltrig("fri after nov 1 SCANFROM -7")
    rem [ffn] msg First Friday after November 1st
    rem [ffn+1] msg First Saturday after first Friday after November 1st
    rem [ffn+2] msg First Sunday after first Friday after November 1st

so that's another option.  Run this one with -dt and -dx to see
the difference.

Regards,

Dianne.

_______________________________________________
Remind-fans mailing list
[email protected]
https://dianne.skoll.ca/mailman/listinfo/remind-fans
Remind is at https://dianne.skoll.ca/projects/remind/

Reply via email to