From 2138b14d897a5e63ecf0d1b97aab69cf9635c54b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 22 Nov 2024 06:04:32 +0100 Subject: [PATCH] Add to update as well. --- app/Services/Internal/Update/JournalUpdateService.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php index 0fd902aa58..1e7fc4f64c 100644 --- a/app/Services/Internal/Update/JournalUpdateService.php +++ b/app/Services/Internal/Update/JournalUpdateService.php @@ -481,13 +481,16 @@ class JournalUpdateService $value = $this->data[$fieldName]; if ('date' === $fieldName) { - if ($value instanceof Carbon) { - // update timezone. - $value->setTimezone(config('app.timezone')); - } if (!$value instanceof Carbon) { $value = new Carbon($value); } + + $value->setTimezone(config('app.timezone')); + // 2024-11-22, overrule timezone with UTC and store it as UTC. + if(FireflyConfig::get('utc', false)) { + $value->setTimezone('UTC'); + } + // do some parsing. app('log')->debug(sprintf('Create date value from string "%s".', $value)); $this->transactionJournal->date_tz = $value->format('e');