Creates a new Todo instance.
Optional
options: {Optional configuration for the new todo.
Optional
completed?: booleanWhether the todo is completed.
Optional
completionDate?: stringWhen the todo was completed.
Optional
contexts?: string[]Array of context tags starting with "@".
Optional
creationDate?: stringWhen the todo was created.
Optional
description?: stringThe description text.
Optional
due?: stringDue date in YYYY-MM-DD format.
Optional
keyValues?: { [key: string]: any }Key-value metadata.
Optional
priority?: stringThe priority of the todo (A-Z or in format "(A)").
Optional
projects?: string[]Array of project tags starting with "+".
Get completed status
Set completed status
Get completion date
Set the completion date
Get contexts
Get creation date
Set the creation date
Get description
Get the unique identifier
Get key-value pairs
Get priority
Get projects
Adds a context tag to the todo.
Context tag to add (with or without the @ symbol).
Adds a project tag to the todo.
Project tag to add (with or without the + symbol).
Calculates the number of days until the todo is due.
Number of days, or undefined if no due date.
Decreases priority by one level (e.g., A -> B). If the priority is already Z, removes the priority.
Generates a new todo based on the recurrence pattern.
A new todo with updated due date, or undefined if not recurring.
Gets the due date of the todo, if any.
The due date in YYYY-MM-DD format or undefined.
Gets the recurrence pattern of the todo, if any.
The recurrence pattern or undefined.
Increases priority by one level (e.g., B -> A). If the todo has no priority, sets it to (Z).
Checks if the todo is due today.
True if the todo is due today.
Checks if the todo is overdue.
True if the todo is overdue and not completed.
Marks the todo as completed.
Optional
completionDate: stringOptional completion date in YYYY-MM-DD format. Defaults to today if not provided.
Marks the todo as incomplete, removing any completion date.
Removes a context tag from the todo.
Context tag to remove (with or without the @ symbol).
Removes a key-value pair from the todo.
The key name to remove.
Removes a project tag from the todo.
Project tag to remove (with or without the + symbol).
Sets the description text of the todo.
The new description text.
Sets the due date for the todo.
The due date in YYYY-MM-DD format.
Sets a key-value pair on the todo.
The key name.
The value to store.
Sets the priority of the todo.
Priority letter (A-Z) or null to remove priority.
Sets a recurrence pattern for the todo.
The recurrence pattern configuration.
Toggles completion status of the todo.
The new completion status.
Converts the todo to its string representation.
The todo in todo.txt format.
Class representing a single todo in the todo.txt format. A todo includes completion status, priority, dates, descriptions, and metadata like projects, contexts, and key-value pairs.