[Remind-Fans] Ignore REM a posteriori (depending on further processing)
Tim Chase
remind at tim.thechases.com
Mon Jun 19 09:28:06 EDT 2023
On 2023-06-19 07:22, l0f4r0--- via Remind-fans wrote:
> As I cannot write (because of FROM limitation):
> FSET birthday_or_anniversary(year, name) iif(year==$Ty, name + "'s birthday", name + "'s anniversary [" + ($Ty-year) + " year(s)]")
> REM 10 February FROM 1970-02-10 MSG [birthday_or_anniversary(1970, "Tom")]
While absolutely ugly, horrible, and prevents using other tags with
birthdays/anniversaries for dates earlier than baseyr(), I have
this family of functions
FSET mon2nam(i) choose(i, \
$January, $February, $March, \
$April, $May, $June, \
$July, $August, $September, \
$October, $November, $December, \
"")
FSET happened(y, m, d) mon2nam(m) + " " + d \
+ " FROM " + date(iif(baseyr() > y, baseyr(), y), m, d) \
+ " TAG y" + y
FSET origyear() coerce("INT", iif( \
substr(trigtags(), 1, 1) == "y" && \
strlen(trigtags()) == 5, \
substr(trigtags(), 2, 5), \
year(trigfrom()) \
))
FSET bday() ($Ty - origyear()) + "yo"
FSET anniv() ord($Ty - origyear())
This stashes the actual year in a tag (prefixed with "y"), creates
a FROM with the latest-acceptable-year (max($Ty, baseyr())), and
then has a origyear() to extract that year back out for use in math.
This lets me do things like
REM [happened(1987, 6, 19)] MSG John ([bday()])
REM [happened(2001, 6, 19)] MSG Hannah ([bday()])
REM [happened(1977, 6, 19)] MSG Mom & Dad ([anniv()])
REM [happened(2014, 6, 19)] MSG Bob & Mary ([anniv()])
producing
$ rem
Reminders for Monday, 19th June, 2023 (today):
John (36yo)
Hannah (22yo)
Mom & Dad (46th)
Bob & Mary (9th)
You still can't issue historical (pre-baseyr) reminders like
$ rem 1979-6-19
but you'll at least get accurate ages and Nth anniversaries and
don't have to enter redundant dates.
-tim
More information about the Remind-fans
mailing list