Reminder
Read and write reminders
A reminder, shaped like Event: a constructor, a fetch, and save()/remove() on what you get back. Due dates are DateTimes; EventKit stores date components and this converts both ways. Priority is 0 for none, 1 to 4 high, 5 medium, 6 to 9 low, matching EventKit. Needs reminders access.
Properties
identifierStringStable id. Empty until the reminder has been saved.
titleStringWhat it says.
notesStringLonger text, or null.
isCompletedBooleanWhether it is done.
completionDateDateTime ›When it was completed, or null.
priorityNumber0 none, 1-4 high, 5 medium, 6-9 low.
dueDateDateTime ›When it is due, or null.
listAnyThe list it belongs to.
urlStringAn associated URL, or null.
Methods
.save()RootlessReminderWrites changes, creating the reminder if it is new. Returns itself with the stored values filled in.
.remove()Deletes it.
.complete(done?)RootlessReminderMarks it done, or pass false to un-complete it. Saves immediately.
- done Boolean
Reminder(config?)RootlessReminderCreates a reminder. Call save() on it to write it.
- config Any
- title String required
What it is called.
- notes String
Free text.
- dueDate DateTime
When it is due.
- priority Number
0 none, 1 to 4 high, 5 medium, 6 to 9 low.
- list String
Which list, by title or identifier. The default one when left out.
- isCompleted Boolean
Create it already done.
- url String
A link to attach.
- title String required
Reminder.fetch(query?)[RootlessReminder]Reminders matching a query.
Reminder.lists()[Any]Every reminder list.
returns One { identifier, title, color, isEditable } per list.
Examples
Today's list
var todo = Reminder.fetch({ completed: false, list: "Personal" });
Column({ children: todo.slice(0, 4).map(function (r) {
return Toggle({
value: r.isCompleted,
label: r.title,
style: ToggleStyle.checkbox,
action: "done",
payload: { id: r.identifier },
});
}) })Adding one
var r = new Reminder({
title: "Water the plants",
dueDate: DateTime.now().add(Duration.hours(3)),
priority: 5,
list: "Personal",
});
r.save();