Hi,
I have a datetime column that is displayed well but search on that column causes an error. The column is from Postgresql timestamptz data type. (i.e. 2023-01-18 10:13:01.272 +1000)
In my grid, I need to display the time in this format, d/m/Y H:i:s so I added the following code.
$col[“formatter”] = “datetime”;
$col[“formatoptions”] = array(“srcformat”=>’d/m/Y H:i:s’,”newformat”=>’d/m/Y H:i:s’);
The grid shows correct format like 18/01/2023 00:14:19 in UTC.
The problem is when I search on this column (here I used “less 19/1/2023 00:00:00” as a filter), there is an error. (apache error log)
PHP Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, bool given in C:\\Apache24\\htdocs\\iceGIS3\\lib\\inc\\jqgrid_dist.php:8631\nStack trace:\n#0 C:\\Apache24\\htdocs\\iceGIS3\\lib\\inc\\jqgrid_dist.php(8631): date_format(false, ‘d/m/Y H:i:s’)\n#1 C:\\Apache24\\htdocs\\iceGIS3\\lib\\inc\\jqgrid_dist.php(474): jqgrid->custom_date_format(‘d/m/Y H:i:s’, ’19/01/2023 00:0…’, ‘d/m/Y H:i:s’)\n#2 C:\\Apache24\\htdocs\\iceGIS3\\lib\\inc\\jqgrid_dist.php(373): jqgrid->make_where(Array)\n#3 C:\\Apache24\\htdocs\\iceGIS3\\lib\\inc\\jqgrid_dist.php(3073): jqgrid->construct_where(‘{“groupOp”:”AND…’)\n#4
Could you please let me know what I’m doing wrong?
Thank you!!