Datediff

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Cat
User
Posts: 72

Datediff

Post by Cat »

Hello everyone

any idea how to fix this error?

src\phpfn.php(4440): strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

I have this code in Row_rendered

if (DateDiff(CurrentDate(), $this->FECHA->CurrentValue) < -354) {
   $this->FECHA->CellAttrs["style"] = "background-color: #FD0303";
}

Phpmaker 2023.13 versión PHP 8.1.18


mobhar
User
Posts: 11660

Post by mobhar »

You should check first whether the FECHA field is not empty, for example:

if (!empty($this->FECHA->CurrentValue)) {
    if (DateDiff(CurrentDate(), $this->FECHA->CurrentValue) < -354)
        $this->FECHA->CellAttrs["style"] = "background-color: #FD0303";
}

Cat
User
Posts: 72

Post by Cat »

Thank you

running


Post Reply