From 7ee925a9b4a01b3e5e8cd67fcc98b92ddf691f2c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 6 Jul 2018 13:38:55 +0200 Subject: rem: do not emit zero-length duration --- rem.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rem.lua b/rem.lua index c8826dc..1c0887a 100644 --- a/rem.lua +++ b/rem.lua @@ -216,7 +216,11 @@ local rem_of_vcalendars do --[[-- remind(1): Note that duration is specified in hours and minutes. --]]-- local s - local ret = "" + local ret + + if dt == 0 then return nil end + + ret = "" s = dt % 60 ret = ret .. stringformat ("%0.2d", s) @@ -230,6 +234,9 @@ local rem_of_vcalendars do local rem_date_duration = function (t0, te, loctime) local dt = te - t0 local s_t0 = rem_date (t0, loctime) + + if dt == 0 then return s_t0 end + local s_dt = rem_duration (dt) return stringformat ("%s DURATION %s", s_t0, s_dt) -- cgit v1.2.3