Fix CarbonImmutable checks.
This commit is contained in:
parent
4324f94cb2
commit
6316df6106
|
@ -406,7 +406,7 @@ final class Scheduler
|
|||
if (!empty($startDate)) {
|
||||
$startDate = CarbonImmutable::createFromFormat('Y-m-d', $startDate, $now->getTimezone());
|
||||
|
||||
if (false !== $startDate) {
|
||||
if (null !== $startDate) {
|
||||
$startDate = $startDate->setTime(0, 0);
|
||||
if ($now->lt($startDate)) {
|
||||
return false;
|
||||
|
@ -417,7 +417,7 @@ final class Scheduler
|
|||
if (!empty($endDate)) {
|
||||
$endDate = CarbonImmutable::createFromFormat('Y-m-d', $endDate, $now->getTimezone());
|
||||
|
||||
if (false !== $endDate) {
|
||||
if (null !== $endDate) {
|
||||
$endDate = $endDate->setTime(23, 59, 59);
|
||||
if ($now->gt($endDate)) {
|
||||
return false;
|
||||
|
|
|
@ -848,7 +848,7 @@ final class ConfigWriter implements EventSubscriberInterface
|
|||
if (!empty($startDate)) {
|
||||
$startDateObj = CarbonImmutable::createFromFormat('Y-m-d', $startDate, $tzObject);
|
||||
|
||||
if (false !== $startDateObj) {
|
||||
if (null !== $startDateObj) {
|
||||
$startDateObj = $startDateObj->setTime(0, 0);
|
||||
|
||||
$customFunctionBody[] = ' # ' . $startDateObj->__toString();
|
||||
|
@ -860,7 +860,7 @@ final class ConfigWriter implements EventSubscriberInterface
|
|||
if (!empty($endDate)) {
|
||||
$endDateObj = CarbonImmutable::createFromFormat('Y-m-d', $endDate, $tzObject);
|
||||
|
||||
if (false !== $endDateObj) {
|
||||
if (null !== $endDateObj) {
|
||||
$endDateObj = $endDateObj->setTime(23, 59, 59);
|
||||
|
||||
$customFunctionBody[] = ' # ' . $endDateObj->__toString();
|
||||
|
|
Loading…
Reference in New Issue