Commit edbd6ea
Fix relative time text (e.g "today ago") (#53)
* Fix relative time text
* Base today/yesterday/tomorrow on calendar dates
The previous logic bucketed by elapsed hours (<24h/<48h), so a timestamp
less than a day away but on a different calendar date could be mislabeled
(e.g. a row reading "2026-06-24 today"). Since dateRow prints the civil
date via t.Format("2006-01-02"), compare civil dates instead via a
zone-independent day index so the label always matches the visible date,
including timestamps with explicit offsets. Add a testable relativeTimeFrom
seam so the labels can be asserted deterministically.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Ben Word <ben@benword.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 34e5e73 commit edbd6ea
2 files changed
Lines changed: 73 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
299 | 326 | | |
300 | | - | |
301 | | - | |
302 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
303 | 336 | | |
304 | | - | |
| 337 | + | |
305 | 338 | | |
306 | 339 | | |
307 | 340 | | |
308 | 341 | | |
309 | 342 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | 343 | | |
317 | | - | |
| 344 | + | |
318 | 345 | | |
319 | 346 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 347 | + | |
325 | 348 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
330 | 352 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
336 | 359 | | |
337 | | - | |
| 360 | + | |
338 | 361 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
22 | 33 | | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
26 | | - | |
| 37 | + | |
27 | 38 | | |
28 | | - | |
| 39 | + | |
29 | 40 | | |
30 | 41 | | |
31 | 42 | | |
| |||
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
39 | | - | |
40 | 50 | | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
45 | | - | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
0 commit comments