[Remind-Fans] I need your help: Holiday data
Tim Chase
remind at tim.thechases.com
Sat Nov 2 20:18:44 EDT 2024
On 2024-11-02 17:59, Remind list wrote:
> I'd like to include holiday information for as many places as I can
Tangential question about an issue that has bugged me for a while:
I want to keep my holiday determinations in one place. However
they are OMITs for some events and not for others. For example,
our city has most-but-not-all US Federal holidays off. And
environmental-services/trash-pickup is based on the City holiday
schedule. However those holiday dates DO count as OMITs for
other events. And the school holiday schedule is a third
mostly-the-same-but-slightly-different set of holidays.
One (non)solution was to duplicate the date-calculations in one file for
DO within a PUSH/POP block, but I had to maintain the date info in both
places. Or if it was the same file getting DOne, the holiday reminders
would show up multiple times on the calendar.
The closest I've come to minimizing the redundancy is to set a variable
for **every** holiday with **no** OMIT such as
# hol_def.rem
REM Jan 1 MSG New Year's
SET holNY
REM Third Mon Feb SCANFROM [$U-7] MSG President's Day
SET holPres $T
# ...
REM Dec 24 MSG Christmas Eve
SET holXmasEve $T
REM Dec 25 MSG Christmas
SET holXmas $T
Then define groupings of holidays according to their type, either in a
reusable/DOable file
# hol_city.rem
OMIT [holNY]
OMIT [holXmasEve]
OMIT [holXmas]
# library.rem
PUSH
DO hol_city.rem
REM Wed AT 10:00am SKIP MSG Story time
POP
# household.rem
PUSH
DO hol_city.rem
# filching the functions from the wiki
REM Thur +1 AFTER OMITFUNC _garbhol MSG %"Garbage day[_garbdel()]%" %b
POP
# school.rem
PUSH
DO hol_school.rem
REM OMIT Sat Sun SKIP MSG School
POP
or in a PUSH/POP block in the file
PUSH
# Federal holidays delay mail delivery
OMIT [holNY]
OMIT [holPres]
OMIT [holXmasEve]
OMIT [holXmas]
REM May 18 +8 REM %"Pat's birthday%" %b, send a card
# ...
POP
Is there some better solution for having common date-calculations while
selectively OMITing?
-tim
More information about the Remind-fans
mailing list