global-functions: $EitherOr: properly handle time values

This commit is contained in:
Christian Hesse 2023-09-15 09:46:28 +02:00
parent 2a10f43acc
commit 5349c9b52e

View file

@ -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 ];
}