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

Tim Chase remind at tim.thechases.com
Tue Aug 27 09:42:47 EDT 2024


On 2024-08-27 09:02, Remind list wrote:
> So I'm trying something complex.  I'm sure Remind can do it, but I'm not
> sure if **I** can do it.
> 
> Anyway, my first roadblock seems to be an A-Day B-Day schedule.

Hah, I just set up an A/B-day calendar for our son who started HS
this year.

I can't quite tell from your problem-description if it's the same
thing as here, but I have the following in my school.rem file:

SET FirstDayOfSchool date(2024, 8, 12)
SET LastDayOfSchool date(2025, 5, 21)
FSET ab_day(dt) iif(\
  nonomitted(FirstDayOfSchool, dt, "SAT", "SUN") % 2 == 0, \
  "A", "B") + " day"

PUSH
  # school holidays & in-service days
  OMIT Sep 2 2024 MSG Labor Day
  OMIT Sep 3 2024 MSG In service
  OMIT Oct 11 2024 MSG In service
  OMIT Oct 14 2024 MSG Columbus/Indigenous Peoples' Day
  OMIT Nov 1 2024 MSG Veteran's Day/In service
  OMIT Nov 4 2024 MSG Veteran's Day/In service
  OMIT Nov 5 2024 MSG Veteran's Day/In service/Voting
  OMIT Nov 25 2024 THROUGH Nov 29 2024 MSG Thanksgiving
  OMIT Dec 23 2024 THROUGH Jan 6 2025 \
      SATISFY [$Uw > 0 && $Uw < 6] \
      MSG Christmas Break
  OMIT Jan 20 2025 MSG MLK
  OMIT Feb 14 2025 MSG In service
  OMIT Feb 17 2025 MSG President's Day
  OMIT Mar 17 2025 THROUGH Mar 21 2025 MSG Spring Break
  OMIT Apr 18 2025 MSG Good Friday
  OMIT May 22 2025 MSG Bad weather make-up day
  OMIT May 23 2025 MSG Bad weather make-up day
 
  # other school reminders here
  REM [FirstDayOfSchool] THROUGH [LastDayOfSchool] \
    AT 7:45 DURATION 7:25 \
    OMIT Sat Sun SKIP \
    MSG %"Daughter School%" %2

  PUSH
    # some odd events nudge the A/B-day schedule
    # but aren't school holidays so I don't want
    # them messing with daughter's calendar-reminder
    OMIT Oct 2 2024 MSG School: Late Arrival A Day
    OMIT Mar 5 2025 MSG School: Late Arrival B Day
    OMIT Apr 8 2025 MSG School: Late Arrival A Day
    OMIT Apr 23 2025 MSG School: Late Arrival B Day
 
    # finally the actual reminder
    REM [FirstDayOfSchool] THROUGH [LastDayOfSchool] \
      AT 9:00 DURATION 7:25 \
      OMIT Sat Sun SKIP \
      MSG %"Son School [ab_day($T)]%" %2
  POP
POP

> Problem 1:
> 
> I have this construct
> 
> OMIT SAT
> OMIT SUN
> OMIT 2024-09-02
> set a_day 0
> rem 2024-08-27 SKIP *2 SATISFY 1
> if (trigvalid())
>   set a_day 1
> endif
> 
> msg [a_day]
> 
> Sadly, this is triggering every day -- even before 2024-08-27

The last line

> msg [a_day]
  
does indeed trigger every day, including before 2024-8-27 so you
either want a FROM clause or your start-date plus SKIP in this MSG.

> Problem 2:
> 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 .

That's where the nonomitted() function is useful (as used in my
example above).

Here's hoping it's helpful to you!

-tim
PS: and if you happen to be in a certain north-TX school-district
with the calendar above, you're welcome to pilfer it wholesale.






More information about the Remind-fans mailing list