aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-04 10:15:18 +0200
committerChocobozzz <me@florianbigard.com>2019-06-06 11:43:00 +0200
commit4e0c179365461e9f1f04339b3d5b32d538fea0c4 (patch)
tree4c3085cf8d91f5764602a168efb0eef768bb7751 /client/src/app/shared/video
parent838f4a798395006233528969474d94e1c5f52293 (diff)
downloadPeerTube-4e0c179365461e9f1f04339b3d5b32d538fea0c4.tar.gz
PeerTube-4e0c179365461e9f1f04339b3d5b32d538fea0c4.tar.zst
PeerTube-4e0c179365461e9f1f04339b3d5b32d538fea0c4.zip
Fix grouped videos by date
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index eba05c07d..8cf21e9d4 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -167,31 +167,41 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
167 for (const video of this.videos) { 167 for (const video of this.videos) {
168 const publishedDate = video.publishedAt 168 const publishedDate = video.publishedAt
169 169
170 if (currentGroupedDate < GroupDate.TODAY && isToday(publishedDate)) { 170 if (currentGroupedDate <= GroupDate.TODAY && isToday(publishedDate)) {
171 if (currentGroupedDate === GroupDate.TODAY) continue
172
171 currentGroupedDate = GroupDate.TODAY 173 currentGroupedDate = GroupDate.TODAY
172 this.groupedDates[ video.id ] = currentGroupedDate 174 this.groupedDates[ video.id ] = currentGroupedDate
173 continue 175 continue
174 } 176 }
175 177
176 if (currentGroupedDate < GroupDate.YESTERDAY && isYesterday(publishedDate)) { 178 if (currentGroupedDate <= GroupDate.YESTERDAY && isYesterday(publishedDate)) {
179 if (currentGroupedDate === GroupDate.YESTERDAY) continue
180
177 currentGroupedDate = GroupDate.YESTERDAY 181 currentGroupedDate = GroupDate.YESTERDAY
178 this.groupedDates[ video.id ] = currentGroupedDate 182 this.groupedDates[ video.id ] = currentGroupedDate
179 continue 183 continue
180 } 184 }
181 185
182 if (currentGroupedDate < GroupDate.THIS_WEEK && isThisWeek(publishedDate)) { 186 if (currentGroupedDate <= GroupDate.THIS_WEEK && isThisWeek(publishedDate)) {
187 if (currentGroupedDate === GroupDate.THIS_WEEK) continue
188
183 currentGroupedDate = GroupDate.THIS_WEEK 189 currentGroupedDate = GroupDate.THIS_WEEK
184 this.groupedDates[ video.id ] = currentGroupedDate 190 this.groupedDates[ video.id ] = currentGroupedDate
185 continue 191 continue
186 } 192 }
187 193
188 if (currentGroupedDate < GroupDate.THIS_MONTH && isThisMonth(publishedDate)) { 194 if (currentGroupedDate <= GroupDate.THIS_MONTH && isThisMonth(publishedDate)) {
195 if (currentGroupedDate === GroupDate.THIS_MONTH) continue
196
189 currentGroupedDate = GroupDate.THIS_MONTH 197 currentGroupedDate = GroupDate.THIS_MONTH
190 this.groupedDates[ video.id ] = currentGroupedDate 198 this.groupedDates[ video.id ] = currentGroupedDate
191 continue 199 continue
192 } 200 }
193 201
194 if (currentGroupedDate < GroupDate.OLDER) { 202 if (currentGroupedDate <= GroupDate.OLDER) {
203 if (currentGroupedDate === GroupDate.OLDER) continue
204
195 currentGroupedDate = GroupDate.OLDER 205 currentGroupedDate = GroupDate.OLDER
196 this.groupedDates[ video.id ] = currentGroupedDate 206 this.groupedDates[ video.id ] = currentGroupedDate
197 } 207 }