set default period correctly

This commit is contained in:
Danny van Kooten 2018-12-04 11:09:01 +01:00
parent e2fb3aa942
commit e88bf64a39
1 changed files with 2 additions and 3 deletions

View File

@ -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',