diff options
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r-- | client/src/app/shared/shared-main/angular/from-now.pipe.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-main/angular/from-now.pipe.ts b/client/src/app/shared/shared-main/angular/from-now.pipe.ts index 5d85590bb..5e7832807 100644 --- a/client/src/app/shared/shared-main/angular/from-now.pipe.ts +++ b/client/src/app/shared/shared-main/angular/from-now.pipe.ts | |||
@@ -8,27 +8,27 @@ export class FromNowPipe implements PipeTransform { | |||
8 | const argDate = new Date(arg) | 8 | const argDate = new Date(arg) |
9 | const seconds = Math.floor((Date.now() - argDate.getTime()) / 1000) | 9 | const seconds = Math.floor((Date.now() - argDate.getTime()) / 1000) |
10 | 10 | ||
11 | let interval = Math.floor(seconds / 31536000) | 11 | let interval = Math.round(seconds / 31536000) |
12 | if (interval > 1) return $localize`${interval} years ago` | 12 | if (interval > 1) return $localize`${interval} years ago` |
13 | if (interval === 1) return $localize`${interval} year ago` | 13 | if (interval === 1) return $localize`${interval} year ago` |
14 | 14 | ||
15 | interval = Math.floor(seconds / 2592000) | 15 | interval = Math.round(seconds / 2592000) |
16 | if (interval > 1) return $localize`${interval} months ago` | 16 | if (interval > 1) return $localize`${interval} months ago` |
17 | if (interval === 1) return $localize`${interval} month ago` | 17 | if (interval === 1) return $localize`${interval} month ago` |
18 | 18 | ||
19 | interval = Math.floor(seconds / 604800) | 19 | interval = Math.round(seconds / 604800) |
20 | if (interval > 1) return $localize`${interval} weeks ago` | 20 | if (interval > 1) return $localize`${interval} weeks ago` |
21 | if (interval === 1) return $localize`${interval} week ago` | 21 | if (interval === 1) return $localize`${interval} week ago` |
22 | 22 | ||
23 | interval = Math.floor(seconds / 86400) | 23 | interval = Math.round(seconds / 86400) |
24 | if (interval > 1) return $localize`${interval} days ago` | 24 | if (interval > 1) return $localize`${interval} days ago` |
25 | if (interval === 1) return $localize`${interval} day ago` | 25 | if (interval === 1) return $localize`${interval} day ago` |
26 | 26 | ||
27 | interval = Math.floor(seconds / 3600) | 27 | interval = Math.round(seconds / 3600) |
28 | if (interval > 1) return $localize`${interval} hours ago` | 28 | if (interval > 1) return $localize`${interval} hours ago` |
29 | if (interval === 1) return $localize`${interval} hour ago` | 29 | if (interval === 1) return $localize`${interval} hour ago` |
30 | 30 | ||
31 | interval = Math.floor(seconds / 60) | 31 | interval = Math.round(seconds / 60) |
32 | if (interval >= 1) return $localize`${interval} min ago` | 32 | if (interval >= 1) return $localize`${interval} min ago` |
33 | 33 | ||
34 | return $localize`just now` | 34 | return $localize`just now` |