[Remind-Fans] This expression doesn't seem to evaluate correctly

David F. Skoll dfs at roaringpenguin.com
Mon Feb 6 12:05:40 EST 2012


On Mon, 6 Feb 2012 18:51:41 +0200
Rod Johnson <rod.c.johnson at gmail.com> wrote:

> in 2012 mydate is the 20 April
> in 2013 mydate is the 28 April

> If mydate is before the 23 of April then I need to be reminded of an
> appointment on the 23 of April. (as in 2012)
> If mydate is after the 23 of April then I need to be reminded of an
> appointment on the first Monday after mydate. (as in 2013)

Ok... those requirements are somewhat odd, but I'd write it like this:

SET mydate '2012-04-20'
#SET mydate '2013-04-28'

# Find out when mydate triggers
REM [mydate] SATISFY 1

# Adjust
IF $Tm > 4 || ($Tm == 4 && $Td > 23)
   REM Monday [mydate] MSG First Monday after mydate
ELSE
   REM [mydate] MSG Actually on mydate
ENDIF

Regards,

David.


More information about the Remind-fans mailing list