Skip to content

Commit e2b647e

Browse files
committed
Serialize obsolete tasks
1 parent c6c2134 commit e2b647e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/plan/serializer.janet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
(string "# " (plan :title)))
1010

1111
(defn- checkbox [task]
12-
(if (= (task :state) :checked) "[X]" "[ ]"))
12+
(case (task :state)
13+
:open "[ ]"
14+
:checked "[X]"
15+
:obsolete "[~]"))
1316

1417
(defn- serialize-event-title [event]
1518
(string "- " (event :title)))

test/plan/serializer_test.janet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
(day/build-day (d/date 2020 8 1)
1818
@[(event/build-event "Talked to Mike" @["- He has a new car"])]
1919
@[(task/build-task "Develop photos" :open)
20+
(task/build-task "Fix the lamp" :obsolete)
2021
(task/build-task "Pay bills" :checked @["- Electricity" "- Water"])
2122
(task/build-missed-task "Organize photos" (d/date 2020 7 20))])
2223
(day/build-day (d/date 2020 7 31)
@@ -40,6 +41,7 @@
4041
- Talked to Mike
4142
- He has a new car
4243
- [ ] Develop photos
44+
- [~] Fix the lamp
4345
- [X] Pay bills
4446
- Electricity
4547
- Water

0 commit comments

Comments
 (0)