summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmyx2d.md29
-rw-r--r--dulatx.md60
2 files changed, 89 insertions, 0 deletions
diff --git a/cmyx2d.md b/cmyx2d.md
new file mode 100644
index 0000000..672a349
--- /dev/null
+++ b/cmyx2d.md
@@ -0,0 +1,29 @@
+---
+id: cmyx2d
+date: 2026-02-28T12:18:46+0300
+languages: [ru]
+aliases:
+
+reviews:
+
+tags:
+- draft
+- knowledge
+
+- taskwarrior
+---
+# Recurrent tasks в TaskWarrior
+
+Это вид запланированных задач, которые происходят раз в какой-то интервал времени. Эти задачи
+полезны для того, чтобы делать что-то периодическое.
+
+Эта механика прекрасно работает с `due` и `wait`, однако, она НИКАК не работает с `until` и
+`scheduled`, которые очень сильно меня подкупили.
+> [!NOTE]
+> В `Related` разместил свой фикс этой проблемы
+
+## Up
+-
+
+## Related
+- [Fix for recurrent tasks in Taskwarrior](dulatx)
diff --git a/dulatx.md b/dulatx.md
new file mode 100644
index 0000000..668efe5
--- /dev/null
+++ b/dulatx.md
@@ -0,0 +1,60 @@
+---
+id: dulatx
+date: 2026-02-28T12:37:24+0300
+languages: [en]
+aliases:
+
+reviews:
+
+tags:
+- draft
+- invention
+- snippet
+
+- taskwarrior
+---
+# Fix for recurrent tasks in Taskwarrior
+
+I made this patch to fix the issue of `until` and `scheduled` being not recalculated:
+```diff
+diff --git a/src/recur.cpp b/src/recur.cpp
+index 482fc1060..5e2627b40 100644
+--- a/src/recur.cpp
++++ b/src/recur.cpp
+@@ -118,6 +118,30 @@ void handleRecurrence() {
+ rec.setStatus(Task::pending);
+ }
+
++ if (t.has("scheduled")) {
++ Datetime old_scheduled(t.get_date("scheduled"));
++ Datetime old_due(t.get_date("due"));
++ Datetime due(d);
++ auto scheduled = checked_add_datetime(due, old_scheduled - old_due);
++ if (scheduled) {
++ rec.set("scheduled", format(scheduled->toEpoch()));
++ } else {
++ rec.remove("scheduled");
++ }
++ }
++
++ if (t.has("until")) {
++ Datetime old_until(t.get_date("until"));
++ Datetime old_due(t.get_date("due"));
++ Datetime due(d);
++ auto until = checked_add_datetime(due, old_until - old_due);
++ if (until) {
++ rec.set("until", format(until->toEpoch()));
++ } else {
++ rec.remove("until");
++ }
++ }
++
+ rec.set("imask", i);
+ rec.remove("mask"); // Remove the mask of the parent.
+```
+
+## Up
+-
+
+## Related
+- [Recurrent tasks в TaskWarrior](cmyx2d)