Skip to content

Commit

Permalink
Merge pull request box#105 from mushak/fix-graph-select-on-timezone-m…
Browse files Browse the repository at this point in the history
…ismatch

Set correct times in search fields when client and server timezones don't match (fixes box#104)
  • Loading branch information
gtowey committed Aug 15, 2014
2 parents 1eb46c3 + 2ad3ba7 commit 2cb02bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/graph_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ function setup_selection(theplot) {
d = new Date();

// get start datetime for selected fields
d.setTime(Math.floor(ranges.xaxis.from - (TIMEZONE_OFFSET)));
d.setTime(Math.floor(ranges.xaxis.from) + (d.getTimezoneOffset() * 60 * 1000));
start_time = to_sql_date(d);

// get end datetime for selected fields
d.setTime(Math.floor(ranges.xaxis.to - (TIMEZONE_OFFSET)));
d.setTime(Math.floor(ranges.xaxis.to) + (d.getTimezoneOffset() * 60 * 1000));
end_time = to_sql_date(d);

// construct a url with the new time frame the graph is focused on to populate the table on the page.
Expand Down

0 comments on commit 2cb02bf

Please sign in to comment.