convert datetime to use company timezone

This commit is contained in:
Ryan Prather 2025-01-10 14:39:31 +00:00
parent 02fcb0cc54
commit 6260b13df0

View File

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