Add UTC support.

This commit is contained in:
James Cole
2024-11-22 06:03:29 +01:00
parent 07b55bd71f
commit 1bf61f57f5
3 changed files with 17 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ use FireflyIII\Models\PiggyBankRepetition;
use FireflyIII\Models\Recurrence;
use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Support\Facades\FireflyConfig;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Log;
@@ -81,6 +82,8 @@ class AddTimezonesToDates extends Command
foreach (self::$models as $model => $fields) {
$this->addTimezoneToModel($model, $fields);
}
// not yet in UTC mode
FireflyConfig::set('utc', false);
}
private function addTimezoneToModel(string $model, array $fields): void

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Console\Commands\Integrity;
use Carbon\Carbon;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Support\Facades\FireflyConfig;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Collection;
@@ -39,7 +40,7 @@ class ConvertDatesToUTC extends Command
*
* @var string
*/
protected $signature = 'firefly-iii:convert-dates-to-utc';
protected $signature = 'firefly-iii:migrate-to-utc';
/**
* The console command description.
@@ -60,6 +61,8 @@ class ConvertDatesToUTC extends Command
foreach (AddTimezonesToDates::$models as $model => $fields) {
$this->ConvertModeltoUTC($model, $fields);
}
// tell the system we are now in UTC mode.
FireflyConfig::set('utc', true);
return Command::SUCCESS;
}