bug fixes

This commit is contained in:
Michael Simard
2020-12-09 16:14:07 -06:00
parent 04a0176367
commit c7cb5fc54a

View File

@@ -77,9 +77,14 @@ struct StatsController: RouteCollection {
func mostRecentDailyStats (matches:[Match]) -> Stats{ func mostRecentDailyStats (matches:[Match]) -> Stats{
let daysPlayed = getDaysPlayed(matches: matches) let daysPlayed = getDaysPlayed(matches: matches)
let lastDayPlayed = daysPlayed.last
return getStats(matches: matches.filter({ (match) -> Bool in 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
})) }))