diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-07-06 13:38:55 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-09-08 16:12:34 +0200 |
commit | 7ee925a9b4a01b3e5e8cd67fcc98b92ddf691f2c (patch) | |
tree | 8378e0b9100359c645ebc495b7f89762a4193581 | |
parent | ce7ce9908b2a3f32cbfabb6b00ad52e105f0c7f5 (diff) | |
download | caldr-7ee925a9b4a01b3e5e8cd67fcc98b92ddf691f2c.tar.gz |
rem: do not emit zero-length duration
-rw-r--r-- | rem.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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) |