Fixes for timezone [skip ci]

This commit is contained in:
James Cole 2014-07-31 07:37:46 +02:00
parent a41fb81446
commit 52d637e25e
2 changed files with 7 additions and 0 deletions

View File

@ -34,6 +34,10 @@ class ChartController extends BaseController
$start = Session::get('start');
$end = Session::get('end');
\Log::debug('Draw home account chart.');
\Log::debug('From: '.$start.' ('.$start->timezone.')');
\Log::debug('Until: '.$end);
if (is_null($account)) {
// get, depending on preferences:
/** @var \Firefly\Helper\Preferences\PreferencesHelperInterface $prefs */
@ -59,6 +63,7 @@ class ChartController extends BaseController
];
foreach ($accounts as $account) {
\Log::debug('Now building series for ' . $account->name);
$data['series'][] = $this->_chart->account($account, $start, $end);
}

View File

@ -19,7 +19,9 @@ class Chart implements ChartInterface
$current = clone $start;
$today = new Carbon;
$return = ['name' => $account->name, 'id' => $account->id, 'data' => []];
while ($current <= $end) {
\Log::debug('Now at day: ' . $current . '('.$current->timestamp.'), ('.($current->timestamp * 1000).') ');
if ($current > $today) {
$return['data'][] = [$current->timestamp * 1000, $account->predict(clone $current)];
} else {