[Remind-Fans] Thanksgiving in the U.S.
Dianne Skoll
dianne at skoll.ca
Wed Nov 17 10:22:50 EST 2021
On Wed, 17 Nov 2021 10:15:15 -0500
"Paul M. Foster via Remind-fans" <remind-fans at lists.skoll.ca> wrote:
> There's a rather complicated formula for deriving the U.S.
> Thanksgiving holiday in the Remind wiki. The holiday is on the 4th
> Thursday in November every year. From my read of the remind
> algorithm, it seems as though this would be more simply expressed as:
> "REM Thu Nov 22 MSG Thanksgiving Day". November 22 is the earliest
> day on which this event can occur. Am I missing something?
You are correct... but so is the Wiki. :)
If all you want is a reminder of Thanksgiving Day, then yes:
REM Thu Nov 22 MSG Thanksgiving Day
is fine. However, if you want Thanksgiving Day marked as an OMITted
holiday, then the code on the Wiki is better. The remind manual
page has a section about OMITting movable holidays in the section
DETAILS ABOUT TRIGGER COMPUTATION.
Specifically, this:
The main use of SCANFROM is in situations where you want to calculate
the positions of floating holidays. Consider the Labour Day example
shown much earlier. Labour Day is the first Monday in September. It
can move over a range of 7 days. Consider the following sequence:
REM Mon 1 Sept SCANFROM [today()-7] SATISFY 1
OMIT [trigdate()]
REM Mon AFTER MSG Hello
The SCANFROM clause makes sure that Remind begins scanning from 7 days
before the current date. This ensures that Labour Day for the current
year will continue to be triggered until 7 days after it has occurred.
This allows you to safely use the AFTER keyword as shown.
Regards,
Dianne.
More information about the Remind-fans
mailing list