From 94268534de35c414d4c76ccdf7d46ed7a5308693 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 12 Mar 2023 18:35:23 +0100 Subject: [PATCH] manual tz fix override --- app/Console/Commands/SyncSpeedGaming.php | 2 +- .../2023_03_12_173315_tz_fix_override.php | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2023_03_12_173315_tz_fix_override.php diff --git a/app/Console/Commands/SyncSpeedGaming.php b/app/Console/Commands/SyncSpeedGaming.php index ea09839..95304c3 100644 --- a/app/Console/Commands/SyncSpeedGaming.php +++ b/app/Console/Commands/SyncSpeedGaming.php @@ -104,7 +104,7 @@ class SyncSpeedGaming extends Command { $episode->event()->associate($event); $episode->title = $sgEntry['match1']['title']; $start = Carbon::createFromFormat('Y-m-d\TH:i:sP', $sgEntry['when']); - if ($event->fix_timezone) { + if ($event->fix_timezone && !$episode->timezone_fix_override) { $sg_zone = new \DateTimeZone('America/Chicago'); $event_zone = new \DateTimeZone($event->fix_timezone); // if speedgaming is in DST, it fucks up the timestamp diff --git a/database/migrations/2023_03_12_173315_tz_fix_override.php b/database/migrations/2023_03_12_173315_tz_fix_override.php new file mode 100644 index 0000000..b008a4b --- /dev/null +++ b/database/migrations/2023_03_12_173315_tz_fix_override.php @@ -0,0 +1,32 @@ +boolean('timezone_fix_override')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('episodes', function(Blueprint $table) { + $table->dropColumn('timezone_fix_override'); + }); + } +}; -- 2.39.2