From d0704c8c6aa98dd23e3aa6e081faeb14feef4b22 Mon Sep 17 00:00:00 2001 From: Eikou Date: Fri, 22 Jul 2022 15:26:17 +0200 Subject: [PATCH] Fixed issue #87: adapted start date of 'this_week' and 'this_year' stats --- ui/src/components/statsWidget.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/components/statsWidget.vue b/ui/src/components/statsWidget.vue index 3cacb37..36157f8 100644 --- a/ui/src/components/statsWidget.vue +++ b/ui/src/components/statsWidget.vue @@ -106,6 +106,7 @@ export default { if (currentDayOfWeek > 1) { toSubtract = -1 * (currentDayOfWeek - 1) } + toDate.setHours(0, 0, 0, 0) return addDays(toDate, toSubtract) case 'this_month': return new Date(toDate.getFullYear(), toDate.getMonth(), 1) @@ -114,7 +115,7 @@ export default { case 'past_3_months': return addMonths(toDate, -3) case 'this_year': - return new Date(toDate.getFullYear(), 1, 1) + return new Date(toDate.getFullYear(), 0, 1) case 'all_time': return new Date(1969, 4, 20) default: