Skip to content

Commit

Permalink
fix timezone issue for dates coming from pikaday, which are not takin…
Browse files Browse the repository at this point in the history
…g wintertime into account somehow. relates to #134
  • Loading branch information
dannyvankooten committed Oct 30, 2018
1 parent 69870d6 commit 17577d8
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 @@ -116,9 +116,8 @@ class DatePicker extends Component {

// create unix timestamps from local date objects
let before, after;
const timezoneOffset = (new Date()).getTimezoneOffset() * 60;
before = Math.round((+endDate) / 1000) - timezoneOffset;
after = Math.round((+startDate) / 1000) - timezoneOffset;
before = Math.round((+endDate) / 1000) - endDate.getTimezoneOffset() * 60;
after = Math.round((+startDate) / 1000) - startDate.getTimezoneOffset() * 60;

this.setState({
period: period || '',
Expand Down

0 comments on commit 17577d8

Please sign in to comment.