Tasks: a due time with a reminder, and Today and Upcoming views

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-27 10:19:05 -04:00
1 parent d761020869
commit fe651a8c37
6 files changed
+43 -20

No files matched your search

+10
View File
@@ -79,6 +79,16 @@ async function tick(now = new Date(), force = false) {
}
} catch (e) { console.warn('[push] tasks check failed:', e.message); }
}
if (checkEvents && st.tasks && users.can(u, 'tasks')) { // a task with a due time: one reminder when that time comes (within two hours of it), once
try {
for (const t of (await tasks.allTasks()).filter(x => !x.done && x.due === lt.day && x.dueTime && x.dueTime <= lt.hm)) {
const mins = (+lt.hm.slice(0, 2) - +t.dueTime.slice(0, 2)) * 60 + (+lt.hm.slice(3) - +t.dueTime.slice(3)), key = `taskdue:${t.id}:${t.due}:${t.dueTime}`;
if (mins > 120 || st.sent.includes(key)) continue;
st.sent.push(key); st.sent = st.sent.slice(-300); dirty = true;
await send(dir, st, u.id, { title: t.title, body: 'Due now (' + t.dueTime + ')', url: '#/tasks', tag: key });
}
} catch (e) { console.warn('[push] task times failed:', e.message); }
}
if (st.tasks && users.can(u, 'contacts') && st.datesDay !== lt.day && lt.hm >= st.tasksAt) { // birthdays and anniversaries from Contacts, with the gift ideas, with the morning summary
st.datesDay = lt.day; dirty = true;
try {