Skip to content

Commit

Permalink
use server timezone for graph display
Browse files Browse the repository at this point in the history
  • Loading branch information
mbolli committed Feb 9, 2024
1 parent ebedb9b commit 8334fc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/api/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace mbolli\nfsen_ng\api;

use DateTime;
use DateTimeZone;
use mbolli\nfsen_ng\common\Config;
use mbolli\nfsen_ng\common\Debug;

Expand Down Expand Up @@ -290,6 +292,7 @@ public function config() {
'daemon_running' => $daemon_running,
'frontend' => $frontend,
'version' => Config::VERSION,
'tz_offset' => (new DateTimeZone(date_default_timezone_get()))->getOffset(new DateTime('now', new DateTimeZone('UTC'))),

This comment has been minimized.

Copy link
@BobRyan530

BobRyan530 Mar 12, 2024

Contributor

This calculated offset is in seconds, but the code uses it as an offset in hours. It's thus off by a factor of 3600 or ~3 years for those of us in PST8PDT

];
}

Expand Down
7 changes: 6 additions & 1 deletion frontend/js/nfsen-ng.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8334fc9

Please sign in to comment.