[Remind-Fans] Can Someone Double-Check Me on These 'Remind' Expressions?

Justin Alcorn justin at jalcorn.net
Wed Aug 16 14:29:45 EDT 2006


Mike Harris wrote:
> A bit embarrassing, but my brain is choking on how to state this as a Remind expression.
> 
> Payday case #1:
> If the 14th of the month is not a Saturday or a Sunday, payday.  If it is, the preceding workday.
> 
> Payday case #2:
> If the day *before* the last day of the month is not a Saturday or Sunday, payday.  if it is, the preceding workday.
> 
I'm in exactly the same, except it's the 15th and last day:

REM 1 -1 OMIT Sat Sun MSG %"Justin Payday%" %a%
REM 16 -1 OMIT Sat Sun MSG %"Justin Payday%" %a%

If I read this correctly:

The OMIT portion of the REM command is used to "omit" certain days when
counting the delta or back.  It is specified  using  the  keyword  OMIT
followed  by  a  list of weekdays.  Its action is best illustrated with
examples:

      REM 1 +1 OMIT Sat Sun MSG Important Event

This reminder is normally triggered on the first  of  every  month,  as
well as the day preceding it.  However, if the first of the month falls
on a Sunday or Monday, then the reminder is triggered starting from the
previous Friday.  This is because the delta of +1 does not count Satur-
day or Sunday when it counts backwards from the trigger date to  deter-
mine how much advance warning to give.

Contrast  this  with  the  use  of "++1" in the above command.  In this
case, the reminder is triggered on the first of each month, as well  as
the day preceding it.  The omitted days are counted.

      REM 1 -1 OMIT Sat Sun MSG Last working day of month

Again, in the above example, the back of -1 normally causes the trigger
date to be the last day of the month.  However,  because  of  the  OMIT
clause,  if  the  first  of  the month falls on a Sunday or Monday, the
trigger date is moved backwards past the weekend to  Friday.   (If  you
have  globally  omitted  holidays, the reminder will be moved back past
them, also.  See "The OMIT command" for more details.)

By comparison, if we had used "--1", the reminder would be triggered on
the last day of the month, regardless of the OMIT.

Then this should give you the payday correct, but warn you even on Sat 
and Sun:

REM 1 -2 OMIT Sat Sun +2 MSG %"Mike Payday%" %a%
REM 15 -1 OMIT Sat Sun +2 MSG %"Mike Payday%" %a%

While this will warn you only on weekdays, completely ignoreing Sat and 
Sun.  WARNING: I could be wrong.

REM 1 -2 OMIT Sat Sun +2 OMIT Sat Sun MSG %"Mike Payday%" %a%
REM 15 -1 OMIT Sat Sun +2 OMIT Sat Sun MSG %"Mike Payday%" %a%

Hmmm...OK, interesting.   Thre reminders come up on Sat and Sun, but 
ALSO the Thur and Fri before, so it DOES count back NOT INCLUDING sat 
and sun.


[jalcorn at bigfoot jalcorn]$ cat testrem
REM 1 -2 OMIT Sat Sun +2 MSG %"Mike Payday%" %a%
REM 15 -1 OMIT Sat Sun +2 MSG %"Mike Payday%" %a%

[jalcorn at bigfoot jalcorn]$ remind testrem Oct 30 2006
Reminders for Monday, 30th October, 2006:

Mike Payday today
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 29 2006
Reminders for Sunday, 29th October, 2006:

Mike Payday tomorrow
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 28 2006
Reminders for Saturday, 28th October, 2006:

Mike Payday on Monday, 30 October, 2006
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 27 2006
Reminders for Friday, 27th October, 2006:

Mike Payday on Monday, 30 October, 2006
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 26 2006
Reminders for Thursday, 26th October, 2006:

Mike Payday on Monday, 30 October, 2006
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 25 2006
No reminders.

[jalcorn at bigfoot jalcorn]$ remind testrem Oct 14 2006
No reminders.
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 13 2006
Reminders for Friday, 13th October, 2006:

Mike Payday today
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 12 2006
Reminders for Thursday, 12th October, 2006:

Mike Payday tomorrow
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 11 2006
Reminders for Wednesday, 11th October, 2006:

Mike Payday on Friday, 13 October, 2006
[jalcorn at bigfoot jalcorn]$ remind testrem Oct 10 2006
No reminders.





> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.whatexit.org
> http://lists.whatexit.org/mailman/listinfo/remind-fans




More information about the Remind-fans mailing list