Ok so I have two dates for each entry, planned date and actual date. I want to compare these two and change text color of the actual date to red if it is later than the planned date.
What I have so far:
$crud->callback_column('actualstart',array($this,'_RedMarker'));
and
public function _RedMarker($value, $row) { if($row->actualstart>$row->plannedstart) { return '<span style="color:red"><span>'.$row->actualstart; } else { return $row->actualstart; } }
My problem is When I use the callback it seems to get the date in Y-m-d format, then tries to compare it planned date which is in d-m-Y format. Which obviously gives wrong results, and on top of that the date format on the table also changes to Y-m-d. (See attached)
How can I get the date in d-m-Y format or is there way to change grocery crud date format to Y-m-d (). If you have any other solutions im open to suggestions.