Skip to content

Commit 4e2f0ea

Browse files
committed
Fix minor error in graph date manipulation
1 parent 306fb06 commit 4e2f0ea

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

gentelella/ga-dashboard-graph-flot/ga-dashboard-graph-flot.component.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ angular
1818
controller: [
1919
function GaGraphFlotController() {
2020
var self = this;
21-
21+
2222
// Initialise
2323
self.$onInit = function () {
2424
if (!self.graphId) self.graphId = 'main-graph';
2525
self.plotted = false;
2626
};
27-
27+
2828
// Run on every digest cycle
2929
// The only suitable event, because the id in template is set after any other event
3030
// This is why we call plot only once with self.plotted
3131
self.$doCheck = function () {
3232
var canvas = $('.' + self.graphId);
33-
33+
3434
if (!self.plotted && self.graphData && canvas.length) {
35-
35+
3636
// Transform mongo data to flot data
3737
var data = [];
3838
self.graphData.forEach(function (row) {
@@ -45,11 +45,11 @@ angular
4545
});
4646
data.push(series);
4747
});
48-
48+
4949
function gd(year, month, day) {
50-
return new Date(year, month - 1, day + 1).getTime();
50+
return new Date(year, month - 1, day).getTime();
5151
}
52-
52+
5353
// PLOT
5454
// !self.plotted && self.graphData && canvas.length && $.plot(canvas, self.graphData, {
5555
$.plot(canvas, data, {
@@ -96,7 +96,7 @@ angular
9696
},
9797
tooltip: false
9898
});
99-
99+
100100
self.plotted = true;
101101
}
102102
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-gentelella",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Angular admin interface based on Gentelella bootstrap theme markup",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)