Part of #5821, split out. Its earlier attempts failed while doing the module and the rendering in one run, so this issue covers only the logic.
Done when:
[ ] src/web/studio/day_divider.ts exports dayLabel(iso, now) → Today | Yesterday | Mon 20 Oct (UTC; a year is added only when it differs from now's), and dividers(items, now, lastDayOnPage?), which returns, in order, the labels to put before each item whose UTC day differs from the previous item's. With lastDayOnPage given, it adds no label for that day.
[ ] test/day-divider.test.ts covers three days in order, midnight UTC on either side, an unparsable time (no label), and lastDayOnPage suppressing a repeat.
[ ] Plain data in, plain data out: nothing here touches the db or HTML.
Part of #5821, split out. Its earlier attempts failed while doing the module and the rendering in one run, so this issue covers only the logic.
Done when:
dayLabel(iso, now)→Today|Yesterday|Mon 20 Oct(UTC; a year is added only when it differs from now's), anddividers(items, now, lastDayOnPage?), which returns, in order, the labels to put before each item whose UTC day differs from the previous item's. WithlastDayOnPagegiven, it adds no label for that day.lastDayOnPagesuppressing a repeat.Files: src/web/studio/day_divider.ts, test/day-divider.test.ts.