[Remind-Fans] weekdays in intervals (ie: "every third Tuesday and Thursday")?

Paul Pelzl pelzlpj at eecs.umich.edu
Wed May 31 19:46:05 EDT 2006


On Wed, May 31, 2006 at 03:36:43PM -0700, Andrey Yurovsky wrote:
> For example, if I want a reminder for every Tuesday and Thursday starting at
> a given date and ending at a given date, it's very doable using UNTIL and
> trigdate() and specifying Tue Thu.  For example:
> 
> REM Tue Thu UNTIL 30 May 2006 SATISFY [trigdate() >= '2006-05-9'] MSG Tue
> Thu
> 
> However if I want every other (or every third, etc) Tuesday Thursday, I am
> not sure how to do it as one REM statement.  How would I approach that?

I would probably schedule separate reminders for the different days of
the week:

   REM May 9 2006 *14 UNTIL 30 May 2006 MSG Every other Tuesday
   REM May 11 2006 *14 UNTIL 30 May 2006 MSG Every other Thursday

If your goal is to wrap this up into a single REM statement, you could
probably script it something like this (untested):

   # first arg should be a Sunday so that 'currdate' within the same week
   # returns 0, within the following week returns 1, etc.
   FSET _countweeks(startdate, currdate) (currdate - startdate)/7

   REM Tue Thu UNTIL 30 May 2006 SATISFY [(trigdate() >= '2006-05-09')
&& (_countweeks('2006-05-07', trigdate()) % 2 == 0)] MSG Every other Tue
Thu

Hope that helps,

Paul





More information about the Remind-fans mailing list