On 2025-11-27 12:31, Tim Chase via Remind-fans wrote:
On 2025-11-27 09:42, Remind list wrote:
I am wondering if there is a way to have the duration of an event
display in the agenda mode? I want to send my agenda daily via email,
for access before I am at my computer.

You can pull it in with trigduration():

 REM AT 9:00 DURATION 3:00 \
   MSG This starts at %3 and lasts [trigduration()]

If you plan to use it regularly, you might do something like

 FSET timespan() iif(trigtime() \
   ,trigtime() \
     + iif(trigduration() == -1, "", " for " + trigduration()) \
   , "")

 REM AT 9:00 DURATION 0:30 MSG Provided both [timespan()]
 REM AT 9:00 MSG Just a time [timespan()]
 REM MSG No time or duration [timespan()]

which is a little more graceful when AT or DURATION isn't specified.

Alternatively, you can use the trigduration() to determine the end time:

 FSET timespan() iif(trigtime() \
  ,trigtime() \
    + iif(trigduration() == -1, "", \
      "-" + (trigtime() + trigduration())) \
  , "")

I prefer the latter, so have something like this in my helpers.rem file

There's is the small hiccup that remind/trigtime() can't readily tell
the difference between *no* AT entry and AT 00:00.

 REM MSG No start time [trigtime()]
 REM AT 00:00 MSG Yes start time [trigtime()]

returns

 No start time 0
 Yes start time 00:00

which, in a boolean context both get interpreted the same.

Thank you both Diane and Tim! This is exactly what I am looking for!

Aric
_______________________________________________
Remind-fans mailing list
[email protected]
https://dianne.skoll.ca/mailman/listinfo/remind-fans
Remind is at https://dianne.skoll.ca/projects/remind/

Reply via email to