aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/misc
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-11-15 09:24:56 +0100
committerChocobozzz <me@florianbigard.com>2018-11-15 09:25:32 +0100
commit2fbe7f1933f4bd5de96e6428234e56965616120e (patch)
tree7dfd9473d5984a35e35a8395d5da26d3a6c8858d /client/src/app/shared/misc
parent79c2480f46ba5ffad6131ca599653d8b224b1c32 (diff)
downloadPeerTube-2fbe7f1933f4bd5de96e6428234e56965616120e.tar.gz
PeerTube-2fbe7f1933f4bd5de96e6428234e56965616120e.tar.zst
PeerTube-2fbe7f1933f4bd5de96e6428234e56965616120e.zip
Fix new Angular 7 issues
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r--client/src/app/shared/misc/from-now.pipe.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/app/shared/misc/from-now.pipe.ts b/client/src/app/shared/misc/from-now.pipe.ts
index 33e6d25fe..00b5be6c9 100644
--- a/client/src/app/shared/misc/from-now.pipe.ts
+++ b/client/src/app/shared/misc/from-now.pipe.ts
@@ -7,8 +7,9 @@ export class FromNowPipe implements PipeTransform {
7 7
8 constructor (private i18n: I18n) { } 8 constructor (private i18n: I18n) { }
9 9
10 transform (value: number) { 10 transform (arg: number | Date | string) {
11 const seconds = Math.floor((Date.now() - value) / 1000) 11 const argDate = new Date(arg)
12 const seconds = Math.floor((Date.now() - argDate.getTime()) / 1000)
12 13
13 let interval = Math.floor(seconds / 31536000) 14 let interval = Math.floor(seconds / 31536000)
14 if (interval > 1) { 15 if (interval > 1) {