Skip to content

Commit

Permalink
set default period correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Dec 4, 2018
1 parent e2fb3aa commit e88bf64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/src/js/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit e88bf64

Please sign in to comment.