aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-09-15 09:46:28 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-09-15 09:54:59 +0200
commit5349c9b52e48a1cc5245c8b76492cbbf2bd45ac4 (patch)
tree5210a00020da4dae19aba23ef55a8071cab937d7 /global-functions.rsc
parent2a10f43acc781359f05e59fc2305144f5027a31a (diff)
global-functions: $EitherOr: properly handle time values
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc3
1 files changed, 3 insertions, 0 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 55f8af6..3d35a8d 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -309,6 +309,9 @@
:if ([ :typeof $1 ] = "num") do={
:return [ $IfThenElse ($1 != 0) $1 $2 ];
}
+ :if ([ :typeof $1 ] = "time") do={
+ :return [ $IfThenElse ($1 > 0s) $1 $2 ];
+ }
:return [ $IfThenElse ([ :len [ :tostr $1 ] ] > 0) $1 $2 ];
}