Real date as label

This commit is contained in:
Michael Simard
2020-06-20 13:21:18 -05:00
parent 4964b44f1d
commit dae169f250

View File

@@ -377,7 +377,9 @@ struct StatsController: RouteCollection {
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)")
let x = Double(cumulativeWinLossRatios.count)
cumulativeWinLossRatios.append(DataPoint(x:x , y: (totalWins/totalLosses).truncate(places: 2), label:"\(date.timeIntervalSince1970*1000)"))
let d = Date(timeIntervalSince1970: date.timeIntervalSince1970)
cumulativeWinLossRatios.append(DataPoint(x:x , y: (totalWins/totalLosses).truncate(places: 2), label:("\(Utilities.monthToString(month: d.month)) \(d.day)")))
}
allDailyStats.append(DailyStats(day: first.day, month: first.month, year: first.year, stats: stats, cumulativeRatio: self.getRatio(num: totalWins, den: totalLosses)))
return getRatios(remaining, allDailyStats:&allDailyStats, cumulativeWinLossRatios:&cumulativeWinLossRatios, eventLoop: eventLoop)