mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
* Fix from-now.pipe.ts so it never displays negative seconds * Apply the fix only when returning seconds. Remove redundant Math.floor operation
This commit is contained in:
committed by
Chocobozzz
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) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user