Hi
Inside the “filter_display” loop I am converting an integer value in minutes to a date/time:
$yourDate = new DateTime(‘2021-01-01 00:00:00’);
$interval = new DateInterval(“PT{$d[“departureTime”]}M”);
$yourDate->add($interval);
$d[“departureTime”]= $yourDate;
This returns a value in the format e.g. 2021-01-05 14:40:00.000000
I have the ‘departureTime’ col set up as below:
$col = array();
$col[“title”] = “Dep Time (Local)”;
$col[“name”] = “departureTime”;
$col[“visible”] = “xs+”; // show on small screens
$col[“editable”] = true;
$col[“formatter”] = “datetime”;
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d H:i:s.v’,”newformat”=>’H:i’,
“opts” => array(“timeOnly” => true, “timeFormat”=>”HH:mm”));
The result shows as “false” in the grid and it should show as a time as HH:mm
Hi,
Currently, the internal code does not support date with mili-seconds format.
You can try removing (the bold text) the ‘2021-01-05 14:40:00.000000‘ from date using filter loop and in source format setting of date column, removing the “.v” in “srcformat”=>’Y-m-d H:i:s.v’.
Hopefully this should work.
PS: Sorry for the delay.