[Remind-Fans] Overdue items (cont.) -> plural()

morel_rf at armory.com morel_rf at armory.com
Thu Dec 11 20:21:43 EST 2014


I'm not sure if plural(-1) behavior in that version is generally a bug 
or feature, and don't know if it's changed in the current version:

$ remind <(echo "[version()] : [plural(-1)]")
Reminders for Thursday, 11th December, 2014 (today):

03.01.05 : s

Tony

> I've always thought "1 days" comes from lazy programming or illiterate
> programmers.
> 
> > Oops. The plural() isn't needed. Substitute
> >
> >   abs(date-today()) + " days ago",\
> >
> > If handling both singular and plural, and if wanted to use plural(),
> > need to handle the -1 case with, e.g.,  FSET _plural(x) plural(abs(x))
> > (in Remind version 03.01.05, anyway.)
> >
> > Tony
> >
> > > FSET _dayinterval(date,phrasing) iif(\
> > >   ((date-today()) < -1),\
> > >   abs(date-today()) + " day" + plural(date-today()) + " ago",\
> > >   ((date-today()) == -1),\
> > >   "yesterday",\
> > >   ((date-today()) == 1),\
> > >   "tomorrow",\
> > >   ((date-today()) > 1),\
> > >   iif(phrasing == "indaystime", "in ","") + \
> > >   (date-today()) + \
> > >   iif(phrasing == "indaystime", " days' time", \
> > >       phrasing == "daysfromnow", " days from now", ""),\
> > >   "today")


More information about the Remind-fans mailing list