Commit ec24796e authored by zacharystenger's avatar zacharystenger Committed by Chocobozzz
Browse files

Fix negative seconds by displaying 0 instead (#1445) (#1625)

* Fix from-now.pipe.ts so it never displays negative seconds

* Apply the fix only when returning seconds. Remove redundant Math.floor operation
parent 7519127b
......@@ -35,6 +35,6 @@ export class FromNowPipe implements PipeTransform {
interval = Math.floor(seconds / 60)
if (interval >= 1) return this.i18n('{{interval}} min ago', { interval })
return this.i18n('{{interval}} sec ago', { interval: Math.floor(seconds) })
return this.i18n('{{interval}} sec ago', { interval: Math.max(0, seconds) })
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment