Building My Daily Hub
Tool 4: The To Do List
Full CRUD, timezone-safe dates, and swapping out window.confirm for a real modal component — the tool I actually use every day.
Tool 4 is the To Do List. Out of all ten tools, this is the one I actually use every single day, so it needed to work right, not just look right on a portfolio screenshot.
CRUD With a Guardrail
Tasks get the full set of operations: add, edit, complete, and delete. But delete isn't wide open. The Delete button is disabled until a task is marked complete. You can't accidentally delete something you're still working on. If you want a task gone, you have to finish it first, or mark it complete just to clear it out. Small rule, but it closes off the most common way people lose work by misclick.
Sorting works two ways too: by due date and priority together, or by priority alone. Incomplete tasks always float to the top regardless of which sort you pick, so finished tasks don't clutter the list you're actually working from.
Dates Without the Timezone Trap
This is the one I want to talk about most, because it's a bug class that's easy to not notice until it bites someone.
JavaScript's Date object assumes a time of day when you parse a bare date string, and then formats that in the browser's local timezone. A due date of "2026-11-10" can come back as November 9th or November 11th depending on where the user's browser thinks it is. It's one of those bugs that passes every test you run from your own desk and then quietly lies to somebody in another timezone.
The fix was to never let a plain due date touch a Date object. I built a small dateFormatter utility: formatUserDate turns "2026-11-10" into "11/10/2026" by splitting the string, no Date object involved. getTodayString and addDaysToDateString do the same thing for "what day is it" and "day plus two" using plain year, month, day math. Everything about a due date stays a string until the moment it's displayed.
The overdue and due-soon indicators on the task list use the same approach: getDueDateStatus compares the due date string against today's string directly, no time-of-day math anywhere in it.
Here's the part worth admitting: during a later cleanup pass, I found the dashboard's task widget had skipped this entirely. It was still calling new Date(task.dueDate).toLocaleDateString(), the exact pattern the utility exists to avoid. The full Tasks page used formatUserDate correctly from day one, but the summary card on the dashboard didn't get the memo. Caught it, fixed it, one line change once I knew where to look.
Replacing window.confirm
Every destructive action in this app used to go through the browser's native window.confirm(). It works, but it looks like every other website's confirm box, and it doesn't match anything about the app's design.
I built a real ConfirmModal component on top of CSS that had been sitting unused since the design system was first set up — a modal-overlay and modal-content pattern that was in the stylesheet but never actually wired to anything. The modal takes a title, a message, and a danger flag that swaps the confirm button to the red btn-danger styling the delete actions already use elsewhere.
The tricky part wasn't the component, it was the conversion. window.confirm() is synchronous. It blocks, and the code right after it just keeps running once the user answers. A React modal can't work that way. Confirming has to happen through state: open the modal, wait for a click, then run the action. That meant every call site needed a small rewrite, not just a straight swap. Escape key and clicking outside the modal both cancel, matching what window.confirm() did natively.
A Few Smaller Details
The database has a trigger, auto_set_completed_at, that sets completed_at the moment a task's is_complete flips to true, and clears it if you uncheck it. I wasn't sure for a while whether that was actually wired up or just a column nobody was writing to. Checked the trigger directly in the schema. It's live.
There's also a Copy button on each task that copies the title and description to the clipboard. The reason is less "task management feature" and more practical: I wanted a fast way to grab a task's text and paste it straight into an AI chat when I needed help thinking through it.
What's Next
Next up is Habits and Goal Definitions, splitting what started as one combined idea into two: the identity of a tracked habit, and the period-based targets set against it. After that, the actual daily tracking screen — the piece that replaces checking a box on the paper tracker.
The live app is at dailyhub.christopherkaelin.com — demo mode works without an account if you want to poke around.