mirror of https://github.com/status-im/fathom.git
add local timezone offset to utc timestamps we send to server. #31
This commit is contained in:
parent
0caf52b780
commit
9cb8d443ec
|
@ -37,6 +37,7 @@ class DatePicker extends Component {
|
||||||
|
|
||||||
@bind
|
@bind
|
||||||
setTimeRange(period) {
|
setTimeRange(period) {
|
||||||
|
const timezoneOffset = (new Date()).getTimezoneOffset() * 60;
|
||||||
let beforeDate = new Date();
|
let beforeDate = new Date();
|
||||||
beforeDate.setHours(24);
|
beforeDate.setHours(24);
|
||||||
beforeDate.setMinutes(0);
|
beforeDate.setMinutes(0);
|
||||||
|
@ -58,8 +59,9 @@ class DatePicker extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let before, after;
|
let before, after;
|
||||||
before = Math.round((+beforeDate ) / 1000);
|
|
||||||
after = Math.round((+afterDate) / 1000);
|
before = Math.round(((+beforeDate) / 1000) + timezoneOffset);
|
||||||
|
after = Math.round(((+afterDate) / 1000) + timezoneOffset);
|
||||||
this.setState({
|
this.setState({
|
||||||
period: period,
|
period: period,
|
||||||
before: before,
|
before: before,
|
||||||
|
|
Loading…
Reference in New Issue