[Remind-Fans] Follow-up on 'counting a recurring event'

David F. Skoll dfs at roaringpenguin.com
Wed Apr 24 09:09:03 EDT 2013


On Tue, 23 Apr 2013 21:47:42 -0400
Roger <aretae at magma.ca> wrote:

> PUSH-OMIT-CONTEXT
>   ⋅OMIT 2013-05-19
>    SET SALSALESSON 0  # Doesn't appear to be required as seems to
> have no effect
>    IF today() >= '2013-05-12'
>     ⋅SET SALSALESSON 
> nonomitted('2013-05-12',today(),"Mon","Tue","Wed","Thu","Fri","Sat")
>     ⋅IF SALSALESSON < 6
>       ⋅REM FROM 2013-05-12 AT 18:00 DURATION 1:00 SKIP MSG Salsa
> Level 1 – #[SALSALESSON + 1] %3
>      ENDIF
> ⋅ENDIF
> POP-OMIT-CONTEXT

That's fairly clever, but it can be simplified to:

PUSH-OMIT-CONTEXT
OMIT 2013-05-19

# Count Sundays from the week before first lesson
# until today.  Use max(...) to avoid error if current
# date < 2013-05-05
SET SALSALESSON nonomitted('2013-05-05', max('2013-05-05', today()), "Mon","Tue","Wed","Thu","Fri","Sat")

REM 2013-05-12 *7 UNTIL 2013-06-23 AT 18:00 DURATION 1:00 SKIP MSG Salsa Level 1 - #[SALSALESSON]
POP-OMIT-CONTEXT

Regards,

David.


More information about the Remind-fans mailing list