diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-22 07:19:41 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-22 07:19:41 -0500 |
| commit | 4ae0429b6a32377cefbfb3d46d3bc9a5cb8613e9 (patch) | |
| tree | adfdbf6c459cdec0b2c0aadcdbb52027de48de56 /tests | |
| parent | 86a06eb53c7a07b4b5c7ca889edad09042384cb4 (diff) | |
| download | chime-4ae0429b6a32377cefbfb3d46d3bc9a5cb8613e9.tar.gz chime-4ae0429b6a32377cefbfb3d46d3bc9a5cb8613e9.zip | |
refactor: extract chime--day-label-for-event-time from chime--group-events-by-day
The date-string computation mixed the today/tomorrow/weekday label selection in with the grouping loop and carried its own pre-decoded copies of NOW and TOMORROW through five let-bindings before it could decide which branch to take. Lift the selection into chime--day-label-for-event-time (event-time now tomorrow). The outer function becomes pure grouping, the label logic gets its own test target, and future label tweaks (localized strings, a "Yesterday" branch for overdue items) edit one helper.
The outer function drops from 36 to 15 lines. The redundant (when event-decoded) guard is replaced by (when event-time) because decode-time always returns a struct for valid time values.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions
