aboutsummaryrefslogtreecommitdiff
path: root/src/then.nim
diff options
context:
space:
mode:
authorhistoria <gravel.justness270@slmail.me>2024-07-30 18:16:27 -0400
committerhistoria <gravel.justness270@slmail.me>2024-07-30 18:16:27 -0400
commitf60ceeaa79af1e2438b8829c8a32f9187ffb6aa7 (patch)
treedb699e0e4e37edace87d6ca69a7c8f1953b217ce /src/then.nim
parent09adbc557969579950f179c9c52c2a9f2c59543e (diff)
downloadsoon-f60ceeaa79af1e2438b8829c8a32f9187ffb6aa7.tar.gz
Minor changes
Diffstat (limited to 'src/then.nim')
-rw-r--r--src/then.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/then.nim b/src/then.nim
index 6137fdf..a74a863 100644
--- a/src/then.nim
+++ b/src/then.nim
@@ -96,6 +96,10 @@ proc checkDateGroup(s: string, date: DateTime): bool =
return false
return true
+proc checkRangeYear(s: string, date: DateTime): bool =
+ var years = s.split('-')
+ return date.year >= years[0] and date.year <= years[1]
+
proc checkCond(cond: string, date: DateTime): bool =
var condition = cond
var invert = false
@@ -126,6 +130,8 @@ proc checkCond(cond: string, date: DateTime): bool =
found = true
of "dategroup":
found = checkDateGroup(condition, date)
+ of "rangeyear":
+ found = checkRangeYear(condition, date)
of "unknown":
echo "ERROR: Unknown condition: ", condition
if invert == true: