This topic is locked

Conditional Fromatting only if Todays Date

8/17/2021 2:50:39 PM
PHPRunner General questions
A
AJShumak author

Hi,
I know there have been many questions about this topic.
(Events in List Page: After Record Processed)
This works and highlights any rows that are in the future:

if ($data["date"] > now())

$record["css"]="background:yellow;";

If I change it to:
if ($data["date"] = now())

$record["css"]="background:yellow;";
All rows get highlighted, I just want the row with todays date highlighted.

Suggestions?

admin 8/17/2021

First of all, = means asisgnment while == means "equals". So instead of
if ($data["date"] = now())
you can try this
if ($data["date"] == now())

Though it is not going to work as now() returns date and time while you only need the date. Check this for inspiration:
https://stackoverflow.com/questions/2113940/compare-given-date-with-today

A
AJShumak author 8/24/2021

Thanks for the pointer, but I'm still not able to figure it out.
Bill me for the code....add to my account...
aj@payplus.ca