Manage tasks (VTODO components) with one of multiple back ends. The Service protocol can be implemented as needed.
A task is a plain map described by the ::task spec:
:uid Non-blank string identifying the task
:summary String
:description String
:status :needs-action, :in-process, :completed or :cancelled
:start When the task starts (DTSTART), and its first occurrence
if it recurs: a date or time, like :due
:due java.time.LocalDate (all-day), LocalDateTime (floating),
ZonedDateTime (local time in a time zone) or Instant (UTC)
:priority Integer, 0 (undefined) and 1 (highest) through 9 (lowest)
:completed java.time.Instant
:created java.time.Instant
:last-modified java.time.Instant
:categories Set of non-blank strings: the task's tags
:parent The :uid of the task this is a subtask of (RELATED-TO).
Nothing cascades: deleting or completing a task leaves
its subtasks as they are
:recurrence The rule the task repeats by (RRULE): a map described in
dgknght.tasks.recurrence
:exdates Set of dates or times of occurrences skipped (EXDATE)
:rdates Set of dates or times of extra occurrences (RDATE)
:overrides Map of an occurrence's original date or time (its
RECURRENCE-ID) to a task map that replaces it, e.g. one
occurrence completed in Thunderbird. These have no :uid
or recurrence keys of their own.
The :extra-* keys hold iCalendar text for data the map doesn't model; see
dgknght.tasks.vtodo and dgknght.ical.
Manage tasks (VTODO components) with one of multiple back ends. The
Service protocol can be implemented as needed.
A task is a plain map described by the `::task` spec:
:uid Non-blank string identifying the task
:summary String
:description String
:status :needs-action, :in-process, :completed or :cancelled
:start When the task starts (DTSTART), and its first occurrence
if it recurs: a date or time, like :due
:due java.time.LocalDate (all-day), LocalDateTime (floating),
ZonedDateTime (local time in a time zone) or Instant (UTC)
:priority Integer, 0 (undefined) and 1 (highest) through 9 (lowest)
:completed java.time.Instant
:created java.time.Instant
:last-modified java.time.Instant
:categories Set of non-blank strings: the task's tags
:parent The :uid of the task this is a subtask of (RELATED-TO).
Nothing cascades: deleting or completing a task leaves
its subtasks as they are
:recurrence The rule the task repeats by (RRULE): a map described in
`dgknght.tasks.recurrence`
:exdates Set of dates or times of occurrences skipped (EXDATE)
:rdates Set of dates or times of extra occurrences (RDATE)
:overrides Map of an occurrence's original date or time (its
RECURRENCE-ID) to a task map that replaces it, e.g. one
occurrence completed in Thunderbird. These have no :uid
or recurrence keys of their own.
The `:extra-*` keys hold iCalendar text for data the map doesn't model; see
`dgknght.tasks.vtodo` and `dgknght.ical`.(children tasks task)The subtasks of the task (those whose :parent is its :uid) among the
tasks, e.g. as returned by list. Their own subtasks aren't included.
The subtasks of the task (those whose :parent is its :uid) among the tasks, e.g. as returned by `list`. Their own subtasks aren't included.
(complete-occurrence service task recurrence-id)(complete-occurrence service task recurrence-id completed-at)Completes the occurrence of the task (as returned by list, get or
put) whose original date is recurrence-id, at completed-at (by
default now), as Apple Reminders does: the occurrence is saved as a new,
completed task of its own, and the task moves on to its next occurrence.
When there's no next occurrence, the task itself is completed instead. See
dgknght.tasks.recurrence/complete.
Returns a map of the saved tasks: the :completed one and, unless the task itself was completed, the :recurring one.
The new task is created first so that the occurrence is never lost. If saving the recurring task then fails (as with a CalDAV conflict, when it changed since it was fetched), the new task is deleted again and the failure is thrown, leaving things as they were.
Completes the occurrence of the task (as returned by `list`, `get` or `put`) whose original date is `recurrence-id`, at `completed-at` (by default now), as Apple Reminders does: the occurrence is saved as a new, completed task of its own, and the task moves on to its next occurrence. When there's no next occurrence, the task itself is completed instead. See `dgknght.tasks.recurrence/complete`. Returns a map of the saved tasks: the :completed one and, unless the task itself was completed, the :recurring one. The new task is created first so that the occurrence is never lost. If saving the recurring task then fails (as with a CalDAV conflict, when it changed since it was fetched), the new task is deleted again and the failure is thrown, leaving things as they were.
Instantiates a Service implementation based on the given configuration.
Instantiates a Service implementation based on the given configuration.
Fetches and saves tasks wherever a provider stores them. Create one with
service.
Fetches and saves tasks wherever a provider stores them. Create one with `service`.
(delete _ task)Deletes the task, as returned by list, get or put, and returns
nil.
Deletes the task, as returned by `list`, `get` or `put`, and returns nil.
(get _ id)Fetches the task with the provider-specific id (for CalDAV, the task's :url, not its :uid), or returns nil if there's no task.
Fetches the task with the provider-specific id (for CalDAV, the task's :url, not its :uid), or returns nil if there's no task.
(list _)Fetches every task. Each has whatever the provider needs to save or delete it again (for CalDAV, its :url and :etag).
Fetches every task. Each has whatever the provider needs to save or delete it again (for CalDAV, its :url and :etag).
(put _ task)Creates the task, or updates it if it has already been saved, and returns it with whatever the provider needs to save or delete it again (for CalDAV, its :url and :etag).
Creates the task, or updates it if it has already been saved, and returns it with whatever the provider needs to save or delete it again (for CalDAV, its :url and :etag).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |