From db41c1a3315f075cda915ab8d03c372dc82f4802 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 13 Jul 2014 14:12:27 +0200 Subject: [PATCH] [FIX] JS compatible time field --- include/classes/statistics.class.php | 2 ++ templates/bootstrap/statistics/graphs/default.tpl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/classes/statistics.class.php b/include/classes/statistics.class.php index c7b2c593..cd49caba 100644 --- a/include/classes/statistics.class.php +++ b/include/classes/statistics.class.php @@ -704,6 +704,7 @@ class Statistics extends Base { $stmt = $this->mysqli->prepare(" SELECT timestamp, + FROM_UNIXTIME(timestamp, '%Y-%m-%d %T') AS time, hashrate FROM " . $this->getUserStatsTableName() . " WHERE @@ -727,6 +728,7 @@ class Statistics extends Base { $stmt = $this->mysqli->prepare(" SELECT timestamp, + FROM_UNIXTIME(timestamp, '%Y-%m-%d %T') AS time, SUM(hashrate) AS hashrate FROM " . $this->getUserStatsTableName() . " GROUP BY timestamp"); diff --git a/templates/bootstrap/statistics/graphs/default.tpl b/templates/bootstrap/statistics/graphs/default.tpl index 65d03503..2b4c2699 100644 --- a/templates/bootstrap/statistics/graphs/default.tpl +++ b/templates/bootstrap/statistics/graphs/default.tpl @@ -13,7 +13,7 @@ $(function () { // ID of the element in which to draw the chart. element: 'mine-area-chart', data: {$YOURHASHRATES}, - xkey: 'timestamp', + xkey: 'time', ykeys: ['hashrate'], labels: ['Hashrate'], pointSize: 2, @@ -29,7 +29,7 @@ $(function () { // ID of the element in which to draw the chart. element: 'pool-area-chart', data: {$POOLHASHRATES}, - xkey: 'timestamp', + xkey: 'time', ykeys: ['hashrate'], labels: ['Hashrate'], pointSize: 2,