projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7519127
)
Fix negative seconds by displaying 0 instead (#1445) (#1625)
author
zacharystenger
<zackstenger@gmail.com>
Tue, 12 Feb 2019 08:16:15 +0000
(
00:16
-0800)
committer
Chocobozzz
<chocobozzz@cpy.re>
Tue, 12 Feb 2019 08:16:15 +0000
(09:16 +0100)
* Fix from-now.pipe.ts so it never displays negative seconds
* Apply the fix only when returning seconds. Remove redundant Math.floor operation
client/src/app/shared/misc/from-now.pipe.ts
patch
|
blob
|
history
diff --git
a/client/src/app/shared/misc/from-now.pipe.ts
b/client/src/app/shared/misc/from-now.pipe.ts
index 00b5be6c9badbf5b87b637f95e9360afb3dcb333..3a9a76411f17b44e807ec1c74374cee007989fb8 100644
(file)
--- a/
client/src/app/shared/misc/from-now.pipe.ts
+++ b/
client/src/app/shared/misc/from-now.pipe.ts
@@
-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) })
}
}