[Remind-Fans] A-Day / B-Day
Dianne Skoll
dianne at skoll.ca
Tue Aug 27 09:26:50 EDT 2024
On Tue, 27 Aug 2024 09:02:41 -0400
Hymie! via Remind-fans <remind-fans at lists.skoll.ca> wrote:
> msg [a_day]
This will trigger every single day. There's no trigger speficiation,
so it's the equivalent of:
REM MSG Hi! You'll see this every day!
> The problem is, the A/B schedule doesn't just skip holidays, it
> **shifts** So when it skips 2024/09/02, that makes 2024/09/03 the
> next A day, followed by 2024/09/05 .
OK. Here's your solution:
#======================================================================
FSET abday(x) iif(nonomitted('2024-08-27', x) % 2, "B Day", "A Day")
OMIT SAT
OMIT SUN
OMIT 2024-09-02
REM FROM 2024-08-27 SKIP MSG [abday($T)]
#======================================================================
The nonomitted() built-in function counts the number of days between
its first and its second argument, *not including* OMITted days.
So we check how many non-omitted days are between 2024-08-27 and the trigger
date. If it's even, it's an A day. If it's odd, it's a B day.
This takes care of day shifts in the face of holidays and weekends.
Regards,
Dianne.
More information about the Remind-fans
mailing list