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

Emanuele Torre torreemanuele6 at gmail.com
Tue Aug 27 10:35:21 EDT 2024


On Tue, Aug 27, 2024 at 04:05:02PM +0200, Emanuele Torre wrote:
> 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

You can also just compare $T == $U, I was confused about how today() and
current() worked.

    $ cat test.rem
    set a_day 0
    rem 2024-08-27 *2 SKIP SATISFY 1
    if trigvalid() && $T == $U
      set a_day 1
    endif
    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