* 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:
parent
7519127b5c
commit
ec24796ea8
|
@ -35,6 +35,6 @@ export class FromNowPipe implements PipeTransform {
|
||||||
interval = Math.floor(seconds / 60)
|
interval = Math.floor(seconds / 60)
|
||||||
if (interval >= 1) return this.i18n('{{interval}} min ago', { interval })
|
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