Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Normalize relative day (#2874)

* fix: normalize relative date

* chore: add comments

* refactor: skip flooring normalized diff

* refactor: let -> const

* fix: get own copy of date to prevent mutating

* refactor: rounding does the same trick

authored by

Mary and committed by
GitHub
4771caf2 1c5a2232

+1 -1
+1 -1
src/lib/strings/time.ts
··· 23 23 } else if (diffSeconds < DAY) { 24 24 return `${Math.floor(diffSeconds / HOUR)}h` 25 25 } else if (diffSeconds < MONTH) { 26 - return `${Math.floor(diffSeconds / DAY)}d` 26 + return `${Math.round(diffSeconds / DAY)}d` 27 27 } else if (diffSeconds < YEAR) { 28 28 return `${Math.floor(diffSeconds / MONTH)}mo` 29 29 } else {