Skip to content

Commit

Permalink
fallback Date constructor argument in case URL doesn't have custom pe…
Browse files Browse the repository at this point in the history
…riod parameters
  • Loading branch information
dannyvankooten committed Dec 10, 2018
1 parent 02ba5b3 commit d6f207d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/src/js/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class DatePicker extends Component {

this.state = {
period: params.p || window.localStorage.getItem('period') || '1w',
startDate: new Date(params.s),
endDate: new Date(params.e),
startDate: new Date(params.s || 'now'),
endDate: new Date(params.e || 'now'),
groupBy: params.g || 'day',
}
this.state.diff = this.calculateDiff(this.state.startDate, this.state.endDate)
Expand Down

0 comments on commit d6f207d

Please sign in to comment.