convert datetime to use company timezone
This commit is contained in:
parent
02fcb0cc54
commit
6260b13df0
@ -6,6 +6,7 @@ use App\Entity\MemberCase;
|
|||||||
use App\Entity\StaffNote;
|
use App\Entity\StaffNote;
|
||||||
use App\Enums\ReferralServiceType;
|
use App\Enums\ReferralServiceType;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use DateTimeZone;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
@ -24,7 +25,7 @@ class StaffNoteFixture extends Fixture implements DependentFixtureInterface
|
|||||||
foreach ($cases as $case) {
|
foreach ($cases as $case) {
|
||||||
/** @var MemberCase $case */
|
/** @var MemberCase $case */
|
||||||
$note = new StaffNote();
|
$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'));
|
$admitDate->add(\DateInterval::createFromDateString('7 day'));
|
||||||
$note->setDate($admitDate);
|
$note->setDate($admitDate);
|
||||||
$note->setMemberCase($case);
|
$note->setMemberCase($case);
|
||||||
|
Loading…
Reference in New Issue
Block a user