mirror of https://github.com/Chocobozzz/PeerTube
* Fix from-now.pipe.ts so it never displays negative seconds * Apply the fix only when returning seconds. Remove redundant Math.floor operationpull/1631/head
parent
7519127b5c
commit
ec24796ea8
|
@ -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) })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue