Functional Weave
Code in Rust

todo.summary@1.0.0

README.md

898 bytes · view raw

# todo.summary

The numbers a todo list shows about itself, in one call: how many there are,
how many are open and done, how many are overdue or due today, the percentage
done and the "N items left" text.

- `overdue` and `dueToday` come from todo.due-status, so they count exactly
  the todos in the Overdue and Today sections of todo.group-by-due. Done
  todos are never counted as overdue.
- **`percentDone` rounds down** (math.round-div, mode `down`): 199 of 200 done
  is 99, not 100, so the bar only reads 100% when everything is done, and
  only reads 0% when nothing is. An empty list is 0.
- `itemsLeft` counts active todos, with English plurals: `"0 items left"`,
  `"1 item left"`, `"2 items left"`. A localised app builds its own string from
  `active`.
- `today` is checked even for an empty list, and a malformed or impossible
  date anywhere is an error (dates.add-days's messages).