From 84e6cb106ca30eae01c52e6bb2c4eb97b624608a Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 2 Feb 2022 14:22:27 +0100 Subject: [PATCH] Basic daily and monthly stats --- src/store/modules/juggl.js | 6 +- src/views/Statistics.vue | 140 +++++++++++++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 9 deletions(-) diff --git a/src/store/modules/juggl.js b/src/store/modules/juggl.js index 19b27bb..00ce8eb 100644 --- a/src/store/modules/juggl.js +++ b/src/store/modules/juggl.js @@ -251,9 +251,11 @@ export const juggl = { { dispatch }, { startYear, startMonth, endYear, endMonth } ) { + + // Month in date object goes from 0 - 11 var options = { - from: new Date(startYear, startMonth, 1), - until: new Date(endYear, endMonth, 0) // 0 leads to the last day of the given month + from: new Date(startYear, startMonth - 1, 2), + until: new Date(endYear, endMonth, 0) // 0 leads to the last day of the previous month }; dispatch("loadStatistics", options); diff --git a/src/views/Statistics.vue b/src/views/Statistics.vue index a338cc1..c4b9bfd 100644 --- a/src/views/Statistics.vue +++ b/src/views/Statistics.vue @@ -1,6 +1,94 @@