diff options
author | Bossett <bossett@bossett.io> | 2023-09-09 01:57:22 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 08:57:22 -0700 |
commit | 775aa875404898ad727960b28c6b271a5a381864 (patch) | |
tree | a74830836ace051622543cc013ff39b22a234f8b /__tests__/lib/errors.test.ts | |
parent | 6d73ed96e1d6bccfa60113727571411f06a2b172 (diff) | |
download | voidsky-775aa875404898ad727960b28c6b271a5a381864.tar.zst |
Update time.ts to handle very small or negative time differences (#1390)
* Update time.ts to handle very small or negative time differences Right now, posts can appear to be from the future with a negative time difference (i.e. -3s appears). This change defines 'NOW' as less than 5 seconds old, and returns 'now' in that case. It's not clear how localisation is handled - this may need translation. * Add test for 'now' in time/ago(...) Add tests for ago() for right now (i.e. 'now') and 10s ago to ensure the seconds case is still tested
Diffstat (limited to '__tests__/lib/errors.test.ts')
0 files changed, 0 insertions, 0 deletions