Commit dda2ab0
committed
fix: keep same-month day durations monotonic
Relative date labels around the month boundary can currently move
backward in precision: a 25-day-old timestamp may render as "last month"
while a 27-day-old timestamp renders as "27 days ago". In sorted date
lists this makes newer items look older than later rows, even when the
underlying timestamps are ordered correctly.
Keep same-calendar-month day spans in days instead of promoting them
through the intermediate four-week representation to one month. Preserve
month rounding once the compared dates cross a calendar-month boundary.
Add regression coverage for the 25/26-day same-month cases so the labels
remain monotonic around the month boundary.1 parent 97fefd8 commit dda2ab0
2 files changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
| |||
0 commit comments