bug fixes
This commit is contained in:
@@ -77,9 +77,14 @@ struct StatsController: RouteCollection {
|
||||
func mostRecentDailyStats (matches:[Match]) -> Stats{
|
||||
|
||||
let daysPlayed = getDaysPlayed(matches: matches)
|
||||
|
||||
let lastDayPlayed = daysPlayed.last
|
||||
|
||||
return getStats(matches: matches.filter({ (match) -> Bool in
|
||||
return match.date.day == daysPlayed.first?.day && match.date.month == daysPlayed.first?.month && match.date.year == daysPlayed.first?.year && match.date.day == daysPlayed.first?.day
|
||||
return
|
||||
match.date.day == lastDayPlayed?.day &&
|
||||
match.date.month == lastDayPlayed?.month &&
|
||||
match.date.year == lastDayPlayed?.year
|
||||
|
||||
}))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user