From 6260b13df001179b63294b1c8092238fbd1ab556 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 10 Jan 2025 14:39:31 +0000 Subject: [PATCH] convert datetime to use company timezone --- src/DataFixtures/StaffNoteFixture.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DataFixtures/StaffNoteFixture.php b/src/DataFixtures/StaffNoteFixture.php index dca4caf..c217e2b 100644 --- a/src/DataFixtures/StaffNoteFixture.php +++ b/src/DataFixtures/StaffNoteFixture.php @@ -6,6 +6,7 @@ use App\Entity\MemberCase; use App\Entity\StaffNote; use App\Enums\ReferralServiceType; use DateTime; +use DateTimeZone; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -24,7 +25,7 @@ class StaffNoteFixture extends Fixture implements DependentFixtureInterface foreach ($cases as $case) { /** @var MemberCase $case */ $note = new StaffNote(); - $admitDate = new DateTime($case->getAdmitDate()?->format('Y-m-d').' '.$gen->time('H:i:s')); + $admitDate = new DateTime($case->getAdmitDate()?->format('Y-m-d').' '.$gen->time('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE'])); $admitDate->add(\DateInterval::createFromDateString('7 day')); $note->setDate($admitDate); $note->setMemberCase($case);