aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-04 10:28:19 +0200
committerChocobozzz <me@florianbigard.com>2019-06-06 11:43:00 +0200
commit93aa85521ae105476cf3122950813593d9105333 (patch)
tree26f014d507fd0f3ba43fec93c48ba4353a0bbe31 /client/src/app/shared/video
parent4e0c179365461e9f1f04339b3d5b32d538fea0c4 (diff)
downloadPeerTube-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.ts22
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'
12import { Notifier, ServerService } from '@app/core' 12import { Notifier, ServerService } from '@app/core'
13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' 13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
14import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
15import { isThisMonth, isThisWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' 15import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date'
16 16
17enum GroupDate { 17enum 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 }