add "version_is_older" script function

This commit is contained in:
GenevensiS
2026-05-11 10:29:29 +02:00
parent 24abf8fe86
commit b13de8e099
3 changed files with 28 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
Function: version_is_older
--Usage--
> version_is_older("version", than: "other version")
Check if a version number is strictly older than another.
Malformed version numbers, including nil, are treated as 0-0-0.
--Parameters--
! Parameter Type Description
| @input@ [[type:string]] Version we want to check.
| @than@ [[type:string]] Version we want to check against.
--Examples--
> version_is_older("2025-06-28", than: "2026-02-18") == true
> version_is_older("2026-02-18", than: "2026-02-18") == false
> version_is_older(nil, than: "0-0-1") == true