playground
tcmts.examples.reminders.playground · #zd4wl4so · ts file
// A scratch file. The reminders app is already in the codebase (see the Codebase sidebar, or `tcm ls reminders`);
// this file is where you try things. Bare expressions are watch expressions: their values show at the end of the line.
import { dueLabel, quickAdd, remindersIn, starter } from "#codebase/reminders";
quickAdd("Call the bank tomorrow !", "2026-10-31");
dueLabel("2026-11-04", "2026-10-31");
remindersIn("flagged", starter(0).reminders, "2026-10-31").map((r) => r.title);
// Try: make quickAdd read "tonight" as flagged too, save, and "Update codebase". `tcm build reminders.App --static
// site` makes a new build; the app's service worker finds it the next time the app is opened, and says so.
export const tonight = (text: string, today: string) => {
const r = quickAdd(text, today);
return /\btonight$/i.test(text.trim()) ? { ...r, flagged: true } : r;
};
tonight("Take the bins out tonight", "2026-10-31");
used by