summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-07-06 13:38:55 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-09-08 16:12:34 +0200
commit7ee925a9b4a01b3e5e8cd67fcc98b92ddf691f2c (patch)
tree8378e0b9100359c645ebc495b7f89762a4193581
parentce7ce9908b2a3f32cbfabb6b00ad52e105f0c7f5 (diff)
downloadcaldr-7ee925a9b4a01b3e5e8cd67fcc98b92ddf691f2c.tar.gz
rem: do not emit zero-length duration
-rw-r--r--rem.lua9
1 files changed, 8 insertions, 1 deletions
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)