From f60ceeaa79af1e2438b8829c8a32f9187ffb6aa7 Mon Sep 17 00:00:00 2001 From: historia Date: Tue, 30 Jul 2024 18:16:27 -0400 Subject: Minor changes --- src/then.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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: -- cgit v1.2.3