From e88bf64a395c913c950266db48b5335bbbbe3465 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Tue, 4 Dec 2018 11:09:01 +0100 Subject: [PATCH] set default period correctly --- assets/src/js/components/DatePicker.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/src/js/components/DatePicker.js b/assets/src/js/components/DatePicker.js index a9ef6abb..44b62c8b 100644 --- a/assets/src/js/components/DatePicker.js +++ b/assets/src/js/components/DatePicker.js @@ -5,8 +5,7 @@ import { bind } from 'decko'; import Pikadayer from './Pikadayer.js'; import classNames from 'classnames'; -const defaultPeriod = 'last-7-days'; -const padZero = function(n){return n<10? '0'+n:''+n;} +const padZero = (n) => n < 10 ? '0'+n : ''+n; let now = new Date(); window.setInterval(() => { @@ -87,7 +86,7 @@ class DatePicker extends Component { super(props) this.state = { - period: window.location.hash.substring(2) || window.localStorage.getItem('period') || defaultPeriod, + period: window.location.hash.substring(2) || window.localStorage.getItem('period') || '1w', startDate: now, endDate: now, groupBy: 'day',