From e8cc58867a2d2c2073ee8279076bf79cd099bc61 Mon Sep 17 00:00:00 2001 From: CyanoFresh Date: Thu, 3 Aug 2017 22:07:45 +0300 Subject: [PATCH] Fixes --- web/js/panel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/js/panel.js b/web/js/panel.js index 0343e6c..8445d47 100644 --- a/web/js/panel.js +++ b/web/js/panel.js @@ -249,7 +249,8 @@ $(document).ready(function () { var $canvas = $modal.find('#item-chart'); Date.prototype.formatMMDDYYYY = function () { - return this.getHours() + ':' + this.getMinutes(); + return (this.getHours() < 10 ? '0' : '') + this.getHours() + + ':' + (this.getMinutes() < 10 ? '0' : '') + this.getMinutes(); }; // Split timestamp and data into separate arrays @@ -258,7 +259,7 @@ $(document).ready(function () { $.each(result.data, function (key, value) { labels.push(new Date(key * 1000).formatMMDDYYYY()); - data.push(parseInt(value)); + data.push(parseFloat(value)); }); // Create the chart.js data structure using 'labels' and 'data'