Skip to content

Commit d639167

Browse files
committed
Update popular talks year logic
1 parent ee5c694 commit d639167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CCCApi/Sources/CCCApi/ApiService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public class ApiService {
8181
// The 'popular' API call returns talks that were popular by year.
8282
// Right after the beginning of a new year, it doesn't return anything
8383
// presumably because there aren't enough views on talk for that year yet.
84-
// So here, we use the year that it was one week ago.
85-
let date = calendar.date(byAdding: .weekOfYear, value: -1, to: Date.now) ?? Date.now
84+
// So here, we use the year that it was two weeks ago.
85+
let date = calendar.date(byAdding: .weekOfYear, value: -2, to: Date.now) ?? Date.now
8686
return calendar.component(.year, from: date)
8787
case let .year(value):
8888
return value

0 commit comments

Comments
 (0)