[Remind-Fans] DURATION enhancement

Ian! D. Allen idallen at idallen.ca
Thu Jan 19 15:51:26 EST 2023


I didn't know about DURATION.  Cool.  Maybe all my multi-day events
should switch to using DURATION.  Some comments:

On Thu, Jan 19, 2023 at 08:37:04AM -0500, Dianne Skoll wrote:
>    REM 2023-01-23 AT 00:00 DURATION 120:00 MSG At hotel

It Would Be Nice If the duration could be specified in days rather than
making the humans do arithmetic in our heads.  I suppose I can write
one of these:

     REM 2023-01-23 AT 00:00 DURATION [5*24]:00 MSG At hotel
     REM 2023-01-23 AT 00:00 DURATION [5*24*60] MSG At hotel

but something like this would be sweeter:

     REM 2023-01-23 AT 00:00 DURATION 5d MSG At hotel

and if you really want to make us happy let us be precise:

     REM 2023-01-23 AT 00:00 DURATION 5d4h3m MSG At hotel

Aside: It's hard to find the definition of the phrase "TIME type"
(used several places) in the man page.  Searching for the string "TIME
type" in the man page finds no definition.  To find the definition,
you have to scroll a third of the way through the page until you find
EXPRESSIONS section, and the phrase "TIME type" isn't even used there.
"TIME data type" is used there, but nowhere else.  Please make them all
the same so we can search for them, and maybe change "TIME" to "TIME type"
in the definition heading?

Another Aside: Even though trigduration() and trigeventduration() both
return a TIME type, the DURATION cannot be specified as a TIME type
constant, e.g. DURATION 1pm is not allowed but DURATION 13:00 is, even
though they both represent the same TIME type internally.  Which leads
me to:

Another Aside: The definition of TIME says it is "times of the day" and
"the number of minutes since midnight".  That definition is not correct
for duration TIME values, especially values greater than 24 hours,
such as can be returned by trigduration() and trigeventduration().
A strict reading of the current definition would say values greater than
24 hours should be invalid in a TIME type (and using such values after
AT confirms this).

In practice, the TIME data type allows any number of hours and it is the
context that provides the limitation, so perhaps the TIME type definition
and examples should be changed to:

TIME type:
    The TIME data type may be used to hold either a time-of-day or a
    duration, depending on context.  (It is stored internally as an
    integer number of minutes.)  Remind will consistently output TIME
    types in hours:minutes ("HH:MM") format using a separator character
    chosen at compile-time (usually ":").  For durations, the hours
    field may range beyond 23 up to ???? hours.

TIME type constants:
    Syntax: Either a period or colon may be used to separate the minutes
    from the hours on input ("12:34" or "12.34"), however Remind will
    consistently output TIME data type values in hours:minutes ("HH:MM")
    format using the separator character chosen at compile-time (usually
    ":").  The examples below will use colon (":").

    There are two types of TIME constants: time-of-day and duration.

    Where a TIME data type constant is used in a time-of-day context
    (not as a duration), it must be given in either 24-hour hours:minutes
    format ("HH:MM") or in 12-hour hours:minutes format suffixed with
    "AM" or "PM".  In 24-hour format, the hour may range from 0-23.
    In "AM/PM" format, then the hour may range from 1 to 12.  Minutes
    range from 0-59.  Examples of TIME time-of-day constants:

    0:33, 12:01, 14:15, 23:59  or  12:33am, 12:01pm, 2:15pm, 11:59pm

    When a TIME data type is used in a duration context (not as a
    time-of-day), it may be given either as a single integer number of
    minutes (max ????), or in hours:minutes ("HH:MM") format (maximum
    ???? hours).  (The "AM/PM" format is not allowed for a duration.)
    Examples of TIME duration constants:

    0:33, 12:01, 14:15, 23:59, 123:45  or  33, 721, 855, 1439, 7425

    Bracketed expressions may be used to do duration arithmetic for you,
    e.g. to express a duration of five days, do the math:

    DURATION [5*24]:00  or  DURATION [5*24*60]

--30--

-- 
| Ian! D. Allen, BA-Psych, MMath-CompSci  idallen at idallen.ca Ottawa CANADA
| Home: www.idallen.com  Contact Improvisation Dance: www.contactimprov.ca
| Former college professor of Free/Libre GNU+Linux @ teaching.idallen.com
| Improve democracy www.fairvote.ca and defend digital freedom www.eff.org


More information about the Remind-fans mailing list