# Support for floating reminders # Daniel A. Graham #-------------------------------------------------------------------------- # Shameless plug: Consider using yeaGTD (www.duke.edu/~dgraham/yeaGTD) # for managing your todo list. It's design goal is to be for todos what # remind is for reminders. #-------------------------------------------------------------------------- # To enable floating reminders make sure your reminders file # includes the line # INCLUDE # prior to any use of float() #-------------------------------------------------------------------------- # Usage: REM [float(YYYY, MM, DD, WarningDays)] MSG ... # Eg. with the reminders entry # REM [float(2008, 4, 15, 7)] MSG File tax return% # "File tax return (today)" # would appear on the calendar for April 15 # Additionally # "File tax return (in 7 days)" # would appear on the calendar for April 8 (until April 9) # "File tax return (in 6 days)" # would appear as a reminder on April 9 # "File tax return (in 5 days)" # would appear as a reminder on April 10 # ... # "File tax return (yesterday)" # would appear as a reminder on April 16 # "File tax return (2 days ago)" # would appear as a reminder on April 17 # ... #-------------------------------------------------------------------------- # Notes: # 1) The reminder appears on the calendar for at most two days - the due # date and either the first warning date or the current date, whichever # is later. # 2) The only way to turn off the nagging is to delete the reminder. # 3) There is no need for a %b entry - the (in N days) suffix is added # automatically. #-------------------------------------------------------------------------- IF ($CalMode || $PSCal ) # For Cal and PS calendars, only trigger the event on the due date. FSET float(y,m,d,n) trigger(date(y,m,d)) ELSE # For Simple Calendar (rem -s) and other modes, also set warning # trigger, priority and suffixes. FSET float(y,m,d,n) iif(date(y,m,d) == today(), trigger(today()) + \ " PRIORITY 1000", trigger(MAX(realtoday(), date(y,m,d)-n)) \ + iif(realtoday() > date(y,m,d) - n, " PRIORITY " + (1000 + (date(y,m,d) \ - realtoday())), " PRIORITY " + (1000 + n))) FSET msgsuffix(x) iif(0 > x, " ", \ 998 >= x, " (" + (1000-x) + " days ago)", \ 999 >= x, " (yesterday)", \ 1000 >= x, " (today)", \ 1001 >= x, " (tomorrow)", \ 2000 >= x, " (in " + (x - 1000) + " days)", \ x >= 2000, " ", \ " ") # This calsuffix is used by wxRemind FSET calsuffix(x) iif(0 > x, " ", \ 998 >= x, " (" + (1000-x) + " days ago)", \ 999 >= x, " (yesterday)", \ 1000 >= x, " (today)", \ 1001 >= x, " (tomorrow)", \ 2000 >= x, " (in " + (x - 1000) + " days)", \ x >= 2000, " ", \ " ") ENDIF