Skip to content

Commit

Permalink
Better timezone offset
Browse files Browse the repository at this point in the history
  • Loading branch information
rzats committed Mar 27, 2024
1 parent b94ad01 commit 333a79c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modes/exportdata/ExportData.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max;
// Also normalize the dates to the current timezone
startDate = new Date(startDate.getTime() + Math.abs(startDate.getTimezoneOffset() * 60000));
endDate = new Date(endDate.getTime() + Math.abs(endDate.getTimezoneOffset() * 60000));
startDate = new Date(startDate.getTime() - startDate.getTimezoneOffset() * -60000);
endDate = new Date(endDate.getTime() - endDate.getTimezoneOffset() * -60000);
}
$: initDate($currentDateObject);
Expand Down Expand Up @@ -122,7 +122,7 @@
asOfMode = 'single';
asOfDate = new Date(urlParams.get('as_of'));
// Also normalize the dates to the current timezone
asOfDate = new Date(asOfDate.getTime() + Math.abs(asOfDate.getTimezoneOffset() * 60000));
asOfDate = new Date(asOfDate.getTime() - asOfDate.getTimezoneOffset() * -60000);
}
let form = null;
Expand Down

0 comments on commit 333a79c

Please sign in to comment.