diff options
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/from-now.pipe.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/client/src/app/shared/misc/from-now.pipe.ts b/client/src/app/shared/misc/from-now.pipe.ts index 3a64a4077..33e6d25fe 100644 --- a/client/src/app/shared/misc/from-now.pipe.ts +++ b/client/src/app/shared/misc/from-now.pipe.ts | |||
@@ -12,28 +12,28 @@ export class FromNowPipe implements PipeTransform { | |||
12 | 12 | ||
13 | let interval = Math.floor(seconds / 31536000) | 13 | let interval = Math.floor(seconds / 31536000) |
14 | if (interval > 1) { | 14 | if (interval > 1) { |
15 | return this.i18n('{{ interval }} years ago', { interval }) | 15 | return this.i18n('{{interval}} years ago', { interval }) |
16 | } | 16 | } |
17 | 17 | ||
18 | interval = Math.floor(seconds / 2592000) | 18 | interval = Math.floor(seconds / 2592000) |
19 | if (interval > 1) return this.i18n('{{ interval }} months ago', { interval }) | 19 | if (interval > 1) return this.i18n('{{interval}} months ago', { interval }) |
20 | if (interval === 1) return this.i18n('{{ interval }} month ago', { interval }) | 20 | if (interval === 1) return this.i18n('{{interval}} month ago', { interval }) |
21 | 21 | ||
22 | interval = Math.floor(seconds / 604800) | 22 | interval = Math.floor(seconds / 604800) |
23 | if (interval > 1) return this.i18n('{{ interval }} weeks ago', { interval }) | 23 | if (interval > 1) return this.i18n('{{interval}} weeks ago', { interval }) |
24 | if (interval === 1) return this.i18n('{{ interval }} week ago', { interval }) | 24 | if (interval === 1) return this.i18n('{{interval}} week ago', { interval }) |
25 | 25 | ||
26 | interval = Math.floor(seconds / 86400) | 26 | interval = Math.floor(seconds / 86400) |
27 | if (interval > 1) return this.i18n('{{ interval }} days ago', { interval }) | 27 | if (interval > 1) return this.i18n('{{interval}} days ago', { interval }) |
28 | if (interval === 1) return this.i18n('{{ interval }} day ago', { interval }) | 28 | if (interval === 1) return this.i18n('{{interval}} day ago', { interval }) |
29 | 29 | ||
30 | interval = Math.floor(seconds / 3600) | 30 | interval = Math.floor(seconds / 3600) |
31 | if (interval > 1) return this.i18n('{{ interval }} hours ago', { interval }) | 31 | if (interval > 1) return this.i18n('{{interval}} hours ago', { interval }) |
32 | if (interval === 1) return this.i18n('{{ interval }} hour ago', { interval }) | 32 | if (interval === 1) return this.i18n('{{interval}} hour ago', { interval }) |
33 | 33 | ||
34 | interval = Math.floor(seconds / 60) | 34 | interval = Math.floor(seconds / 60) |
35 | if (interval >= 1) return this.i18n('{{ interval }} min ago', { interval }) | 35 | if (interval >= 1) return this.i18n('{{interval}} min ago', { interval }) |
36 | 36 | ||
37 | return this.i18n('{{ interval }} sec ago', { interval: Math.floor(seconds) }) | 37 | return this.i18n('{{interval}} sec ago', { interval: Math.floor(seconds) }) |
38 | } | 38 | } |
39 | } | 39 | } |