Add to update as well.

This commit is contained in:
James Cole 2024-11-22 06:04:32 +01:00
parent 1bf61f57f5
commit 2138b14d89
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -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');