From 399c4862094a8f567eb84ab5def098c1a5514231 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 1 May 2018 16:10:39 +0200 Subject: [PATCH] pass period to table component --- assets/js/components/CountWidget.js | 2 +- assets/js/pages/dashboard.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/components/CountWidget.js b/assets/js/components/CountWidget.js index b767822..eab6495 100644 --- a/assets/js/components/CountWidget.js +++ b/assets/js/components/CountWidget.js @@ -25,7 +25,6 @@ class CountWidget extends Component { } componentWillReceiveProps(newProps) { - console.log(newProps); if(this.props.period != newProps.period) { this.fetchData(newProps.period) } @@ -36,6 +35,7 @@ class CountWidget extends Component { let before, after; let afterDate = new Date(); afterDate.setHours(0, 0, 0, 0); + switch(period) { case "week": afterDate.setDate(afterDate.getDate() - (afterDate.getDay() + 6) % 7); diff --git a/assets/js/pages/dashboard.js b/assets/js/pages/dashboard.js index 7bd5bd4..ee5475d 100644 --- a/assets/js/pages/dashboard.js +++ b/assets/js/pages/dashboard.js @@ -52,8 +52,8 @@ class Dashboard extends Component { - -
+
+