aboutsummaryrefslogtreecommitdiff
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
parent09adbc557969579950f179c9c52c2a9f2c59543e (diff)
downloadsoon-f60ceeaa79af1e2438b8829c8a32f9187ffb6aa7.tar.gz
Minor changes
-rw-r--r--README.md12
-rw-r--r--src/then.nim6
2 files changed, 14 insertions, 4 deletions
diff --git a/README.md b/README.md
index 8d8c276..c7bd73e 100644
--- a/README.md
+++ b/README.md
@@ -159,9 +159,9 @@ Julian date modulus is definitely weird, but it's a concise way to express multi
Then was created to adapt existing CLI calendars to my personal workflow. Then is not only for the niche of people who use their terminal for scheduling, but for a sub-niche who prefer to edit a file over using a TUI which is why concise, legible syntax is so important. This is a very small group of people who virtually exclusively use [Remind](https://dianne.skoll.ca/projects/remind/). If you're happy with a web or phone calendar, Then probably won't change your mind.
-Then has a few benefits over similar text file calendars:
+## Then has concise syntax compared to similar programs
-1. Then has the most concise syntax. It minimizes special characters and simplifies ranges.
+It minimizes special characters and simplifies ranges.
**Then**: `1, Water bill`\
**When**: `* * 1, Water bill`\
@@ -177,9 +177,13 @@ Remind is wordier but nicer for recurring cases cases that require Julian dates,
**When**: `m=jul & d>=10 & d<=19 & y=2024 & !(j%3-2)`\
**Remind**: `REM Jul 10 2025 *3 THROUGH Jul 19 2025`
-2. It *optionally* has the ability to archive calendar events. Take the event "Change air filter", scheduled every 6 months. I might see that upcoming and archive this instance a week early, which removes it from my calendar. Or I might let it slide until next weekend, in which case it sticks around until it's done.
+## Then *optionally* can archive calendar events.
-3. It *optionally* shows a to-do list and upcoming deadlines.
+Take the event "Change air filter", scheduled every 6 months. I might see that upcoming and archive this instance a week early, which removes it from my calendar. Or I might let it slide until next weekend, in which case it sticks around until it's done.
+
+I use many calendar events (bills, etc.) as a quasi-todo list, so I need to know when I've actually completed them, not just be reminded on a specific day.
+
+## It *optionally* shows a to-do list and upcoming deadlines.
# Alternatives
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: