[Remind-Fans] Determining "the closest Sunday to $DATE"

Tim Chase remind at tim.thechases.com
Sun May 31 14:41:49 EDT 2020


I have an annual event that falls on "the Sunday closest to Jan 22nd"
and wrestled with how to express this.  I finally came up with the
following which works for all the tests I've thrown at it.

  REM Jan 22 SCANFROM [$U - 7] SATISFY 1
  SET _s iif($Tw < 4, 0, 7) + $T - $Tw
  REM [_s] MSG %"Sanctity of Life Sunday%"%

Thought I'd share, just in case others find it useful or have
improvement suggestions.

-tim





More information about the Remind-fans mailing list