diff options
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/from-now.pipe.ts | 5 |
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) { |