use-minute
a hook that returns the clock's minute and the reader's day, for any line that prints how long until or how long since.
bunx --bun shadcn@latest add @mk/use-minuteexample
useMinute({ timeZone }) returns now, a Date on the whole minute, and day, like 2026-11-03. it returns null while the page is prerendered, because a server has no reader’s clock. feed now to the time words, and a part minute stays out of them.
- now
- not read yet
- day
- not read yet
both copies on this page turn over together, on one timer.
- now
- not read yet
- day
- not read yet
both copies on this page turn over together, on one timer.
midnight
the timer lands on the clock’s next whole minute, so midnight is an ordinary tick. day changes on that tick, in the reader’s zone. a page that reads its data once keys that read on day, and tomorrow arrives without a reload.