[Remind-Fans] A-Day / B-Day

Emanuele Torre torreemanuele6 at gmail.com
Tue Aug 27 10:05:02 EDT 2024


On Tue, Aug 27, 2024 at 09:58:40AM -0400, Hymie! via Remind-fans wrote:
> Dianne Skoll via Remind-fans writes:
> 
> >But trigvalid() will always be true.  Remind is always able to calculate
> >a trigger date for:
> >
> >    rem 2024-08-27 *2 SKIP SATISFY 1
> 
> I'm confused.  I through trigvalid() will be false on 2024-08-28.

The trigdate() is not necessarily the current date, it is the first
matching day after the current day.
If you add $Td == day(current()) to your condition, the code works as
you expect:

    $ cat test.rem
    set a_day 0
    rem 2024-08-27 *2 SKIP SATISFY 1
    if trigvalid() && $Td == day(current())
      set a_day 1
    endif
    rem [day(current())] msg [a_day]

    $ remind -s+1 test.rem
    2024/08/25 * * * * 0
    2024/08/26 * * * * 0
    2024/08/27 * * * * 1
    2024/08/28 * * * * 0
    2024/08/29 * * * * 1
    2024/08/30 * * * * 0
    2024/08/31 * * * * 1

o/
 emanuele6


More information about the Remind-fans mailing list