aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-18 12:12:14 +0100
committerChocobozzz <me@florianbigard.com>2020-11-18 12:12:14 +0100
commit4166caabc6f439a7db7d1e15d64f74b8b694fc6b (patch)
treedbe524c212ea30fdd4843985fa693d22521bbd27 /client/src/app/shared/shared-main
parent875f0610e42fad6046cc731fed1953cb0a451f38 (diff)
downloadPeerTube-4166caabc6f439a7db7d1e15d64f74b8b694fc6b.tar.gz
PeerTube-4166caabc6f439a7db7d1e15d64f74b8b694fc6b.tar.zst
PeerTube-4166caabc6f439a7db7d1e15d64f74b8b694fc6b.zip
Clearer periods in videos list
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/angular/from-now.pipe.ts12
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`