diff --git a/Sources/App/Controllers/StatsController.swift b/Sources/App/Controllers/StatsController.swift index 5c40400..89ed6ca 100644 --- a/Sources/App/Controllers/StatsController.swift +++ b/Sources/App/Controllers/StatsController.swift @@ -72,8 +72,7 @@ struct StatsController: RouteCollection { } func getStatsForDay(year:Int, month:Int, day:Int, req: Request) -> EventLoopFuture{ - - + let winCount = Match.query(on: req.db) .filter(\.$date >= getStartOfDay(day:day, month: month, year: year)) .filter(\.$date <= getEndOfDay(day: day, month: month, year: year)) @@ -180,7 +179,7 @@ struct StatsController: RouteCollection { let calendar = Calendar.current var components = DateComponents() components.timeZone = TimeZone(identifier: "GMT") - components.day = 20 + components.day = 10 components.month = 03 components.year = 2020 components.hour = 4 @@ -362,7 +361,7 @@ struct StatsController: RouteCollection { var cumulativeWinLossRatios = cumulativeWinLossRatios if !(stats.totalWins == 0 && stats.totalLosses == 0) { - let date = self.createDate(day: first.day, month: first.month, year: first.year, hour: first.hour, minute:first.minute) + let date = self.createDate(day: first.day, month: first.month, year: first.year, hour: first.hour + 6, minute:first.minute) // 6 hours to make sure we pick a time that isnt on borders of us time zones print ("p \(date.timeIntervalSince1970)") cumulativeWinLossRatios.append(DataPoint(x:date.timeIntervalSince1970*1000 , y: (totalWins/totalLosses).truncate(places: 2))) }