fix timezone issue for dates coming from pikaday, which are not taking wintertime into account somehow. relates to #134

This commit is contained in:
Danny van Kooten 2018-10-30 16:27:17 +01:00
parent 69870d6fa8
commit 17577d852b
1 changed files with 2 additions and 3 deletions

View File

@ -116,9 +116,8 @@ class DatePicker extends Component {
// create unix timestamps from local date objects // create unix timestamps from local date objects
let before, after; let before, after;
const timezoneOffset = (new Date()).getTimezoneOffset() * 60; before = Math.round((+endDate) / 1000) - endDate.getTimezoneOffset() * 60;
before = Math.round((+endDate) / 1000) - timezoneOffset; after = Math.round((+startDate) / 1000) - startDate.getTimezoneOffset() * 60;
after = Math.round((+startDate) / 1000) - timezoneOffset;
this.setState({ this.setState({
period: period || '', period: period || '',