Skip to content

Firefly III: a personal finances manager

Call correct timezone.

James Colecd65d4d4c543
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php
index a683f19c94..dfad898e8b 100644
--- a/app/Helpers/Collector/GroupCollector.php
+++ b/app/Helpers/Collector/GroupCollector.php
@@ -554,9 +554,9 @@ class GroupCollector implements GroupCollectorInterface
$result['updated_at'] = new Carbon($result['updated_at'], 'UTC');
// this is going to happen a lot:
- $result['date']->setTimezone(env('TZ'));
- $result['created_at']->setTimezone(env('TZ'));
- $result['updated_at']->setTimezone(env('TZ'));
+ $result['date']->setTimezone(config('app.timezone'));
+ $result['created_at']->setTimezone(config('app.timezone'));
+ $result['updated_at']->setTimezone(config('app.timezone'));
} catch (Exception $e) {
Log::error($e->getMessage());
}
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 729539a2f6..27b3856312 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -143,9 +143,8 @@ class Amount
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, bool $coloured = null): string
{
$coloured = $coloured ?? true;
- $float = round($amount, 12);
$info = $this->getLocaleInfo();
- $formatted = number_format($float, $decimalPlaces, $info['mon_decimal_point'], $info['mon_thousands_sep']);
+ $formatted = number_format((float) $amount, $decimalPlaces, $info['mon_decimal_point'], $info['mon_thousands_sep']);
$precedes = $amount < 0 ? $info['n_cs_precedes'] : $info['p_cs_precedes'];
$separated = $amount < 0 ? $info['n_sep_by_space'] : $info['p_sep_by_space'];
$space = true === $separated ? ' ' : '';