29 $userTimeDate = $userTimeDate ?? (
new DateTime())->toUserTime();
31 $possibleDate = clone $userTimeDate;
32 $possibleDate = $possibleDate->disableUserTime();
34 if ($offsetInSeconds <= 0)
39 while ($offsetInSeconds >= self::SECONDS_PER_DAY)
41 $possibleDate->add(
'1 day');
42 $possibleDate = $this->getClosestWorkDate($possibleDate);
44 $offsetInSeconds -= self::SECONDS_PER_DAY;
47 $possibleDate->add($offsetInSeconds .
' seconds');
49 return $this->getClosestWorkDate($possibleDate);