mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
770d092e93
commit
9fdaf1cee8
@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Factory;
|
namespace FireflyIII\Factory;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Exception;
|
use Exception;
|
||||||
use FireflyIII\Exceptions\DuplicateTransactionException;
|
use FireflyIII\Exceptions\DuplicateTransactionException;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
@ -219,6 +220,8 @@ class TransactionJournalFactory
|
|||||||
$foreignCurrency = $this->getForeignByAccount($type->type, $foreignCurrency, $destinationAccount);
|
$foreignCurrency = $this->getForeignByAccount($type->type, $foreignCurrency, $destinationAccount);
|
||||||
$description = $this->getDescription($description);
|
$description = $this->getDescription($description);
|
||||||
|
|
||||||
|
Log::debug(sprintf('Date: %s (%s)', $carbon->toW3cString(), $carbon->getTimezone()->getName()));
|
||||||
|
|
||||||
/** Create a basic journal. */
|
/** Create a basic journal. */
|
||||||
$journal = TransactionJournal::create(
|
$journal = TransactionJournal::create(
|
||||||
[
|
[
|
||||||
@ -601,8 +604,13 @@ class TransactionJournalFactory
|
|||||||
'name' => $field,
|
'name' => $field,
|
||||||
'data' => (string)($data[$field] ?? ''),
|
'data' => (string)($data[$field] ?? ''),
|
||||||
];
|
];
|
||||||
|
if ($data[$field] instanceof Carbon) {
|
||||||
|
$data[$field]->setTimezone(config('app.timezone'));
|
||||||
|
Log::debug(sprintf('%s Date: %s (%s)', $field, $data[$field], $data[$field]->timezone->getName()));
|
||||||
|
$set['data'] = $data[$field]->format('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
//Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data']));
|
Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data']));
|
||||||
|
|
||||||
/** @var TransactionJournalMetaFactory $factory */
|
/** @var TransactionJournalMetaFactory $factory */
|
||||||
$factory = app(TransactionJournalMetaFactory::class);
|
$factory = app(TransactionJournalMetaFactory::class);
|
||||||
|
@ -236,7 +236,7 @@ trait ConvertsDataTypes
|
|||||||
}
|
}
|
||||||
$carbon = null;
|
$carbon = null;
|
||||||
try {
|
try {
|
||||||
$carbon = new Carbon($string);
|
$carbon = new Carbon($string, config('app.timezone'));
|
||||||
} catch (InvalidFormatException $e) {
|
} catch (InvalidFormatException $e) {
|
||||||
// @ignoreException
|
// @ignoreException
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user