diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-04 10:28:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-06 11:43:00 +0200 |
commit | 93aa85521ae105476cf3122950813593d9105333 (patch) | |
tree | 26f014d507fd0f3ba43fec93c48ba4353a0bbe31 /client/src/app/shared/video | |
parent | 4e0c179365461e9f1f04339b3d5b32d538fea0c4 (diff) | |
download | PeerTube-93aa85521ae105476cf3122950813593d9105333.tar.gz PeerTube-93aa85521ae105476cf3122950813593d9105333.tar.zst PeerTube-93aa85521ae105476cf3122950813593d9105333.zip |
Prefer using last week/last month
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 8cf21e9d4..dc8f9cda9 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -12,14 +12,14 @@ import { Syndication } from '@app/shared/video/syndication.model' | |||
12 | import { Notifier, ServerService } from '@app/core' | 12 | import { Notifier, ServerService } from '@app/core' |
13 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | 13 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' |
14 | import { I18n } from '@ngx-translate/i18n-polyfill' | 14 | import { I18n } from '@ngx-translate/i18n-polyfill' |
15 | import { isThisMonth, isThisWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' | 15 | import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' |
16 | 16 | ||
17 | enum GroupDate { | 17 | enum GroupDate { |
18 | UNKNOWN = 0, | 18 | UNKNOWN = 0, |
19 | TODAY = 1, | 19 | TODAY = 1, |
20 | YESTERDAY = 2, | 20 | YESTERDAY = 2, |
21 | THIS_WEEK = 3, | 21 | LAST_WEEK = 3, |
22 | THIS_MONTH = 4, | 22 | LAST_MONTH = 4, |
23 | OLDER = 5 | 23 | OLDER = 5 |
24 | } | 24 | } |
25 | 25 | ||
@@ -84,8 +84,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor | |||
84 | [GroupDate.UNKNOWN]: null, | 84 | [GroupDate.UNKNOWN]: null, |
85 | [GroupDate.TODAY]: this.i18n('Today'), | 85 | [GroupDate.TODAY]: this.i18n('Today'), |
86 | [GroupDate.YESTERDAY]: this.i18n('Yesterday'), | 86 | [GroupDate.YESTERDAY]: this.i18n('Yesterday'), |
87 | [GroupDate.THIS_WEEK]: this.i18n('This week'), | 87 | [GroupDate.LAST_WEEK]: this.i18n('Last week'), |
88 | [GroupDate.THIS_MONTH]: this.i18n('This month'), | 88 | [GroupDate.LAST_MONTH]: this.i18n('Last month'), |
89 | [GroupDate.OLDER]: this.i18n('Older') | 89 | [GroupDate.OLDER]: this.i18n('Older') |
90 | } | 90 | } |
91 | 91 | ||
@@ -183,18 +183,18 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor | |||
183 | continue | 183 | continue |
184 | } | 184 | } |
185 | 185 | ||
186 | if (currentGroupedDate <= GroupDate.THIS_WEEK && isThisWeek(publishedDate)) { | 186 | if (currentGroupedDate <= GroupDate.LAST_WEEK && isLastWeek(publishedDate)) { |
187 | if (currentGroupedDate === GroupDate.THIS_WEEK) continue | 187 | if (currentGroupedDate === GroupDate.LAST_WEEK) continue |
188 | 188 | ||
189 | currentGroupedDate = GroupDate.THIS_WEEK | 189 | currentGroupedDate = GroupDate.LAST_WEEK |
190 | this.groupedDates[ video.id ] = currentGroupedDate | 190 | this.groupedDates[ video.id ] = currentGroupedDate |
191 | continue | 191 | continue |
192 | } | 192 | } |
193 | 193 | ||
194 | if (currentGroupedDate <= GroupDate.THIS_MONTH && isThisMonth(publishedDate)) { | 194 | if (currentGroupedDate <= GroupDate.LAST_MONTH && isLastMonth(publishedDate)) { |
195 | if (currentGroupedDate === GroupDate.THIS_MONTH) continue | 195 | if (currentGroupedDate === GroupDate.LAST_MONTH) continue |
196 | 196 | ||
197 | currentGroupedDate = GroupDate.THIS_MONTH | 197 | currentGroupedDate = GroupDate.LAST_MONTH |
198 | this.groupedDates[ video.id ] = currentGroupedDate | 198 | this.groupedDates[ video.id ] = currentGroupedDate |
199 | continue | 199 | continue |
200 | } | 200 | } |