Fix formatTimestampRelative for future timestamps
This commit is contained in:
@@ -354,7 +354,7 @@ export const formatTimestampAsTime = (ts: number) => timeFormatter.format(second
|
|||||||
*/
|
*/
|
||||||
export const formatTimestampRelative = (ts: number) => {
|
export const formatTimestampRelative = (ts: number) => {
|
||||||
let unit
|
let unit
|
||||||
let delta = now() - ts
|
let delta = Math.abs(now() - ts)
|
||||||
if (delta < int(MINUTE)) {
|
if (delta < int(MINUTE)) {
|
||||||
unit = "second"
|
unit = "second"
|
||||||
} else if (delta < int(HOUR)) {
|
} else if (delta < int(HOUR)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user