Page 1 of 1

Datediff

Posted: Tue May 30, 2023 7:54 am
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


Re: Datediff

Posted: Tue May 30, 2023 8:55 am
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";
}

Re: Datediff

Posted: Tue May 30, 2023 9:06 am
by Cat

Thank you

running