Hello,
In the grid view of data i have 4 columns with date format.
In the columns i used the command:$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'d/m/Y'); for the format of the dates but when i export the data some dates comes with the right format (m/d/Y) and others with the format d/m/Y and the weird is that the difference is in the same column e.g Start date
Could you please help me with this issue?
Kind regards,
Elenu
Hi,
Please email me code + db sql test dump at [email protected]
I am unable to generate this case.
For the start date i use the below code:
$col = array();
$col["title"] = "Start Date";
$col["name"] = "start_date";
$col["dbname"] = "start_date";
$col["width"] = "50";
$col["editable"] = false; // this column is not editable
$col["align"] = "center"; // this column is not editable
$col["search"] = true; // this column is not searchable
$col["formatter"] = "date";
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'d/m/Y');
$col["align"] = "left";
$col["export"] = true;
$cols[] = $col;
The sql query is:
SELECT start_date,end_date,
FROM PMT_ACTIONS_2
Hello,
one info about this issue when we deactivated the row:
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'d/m/Y');
we took the format in the xls right but the column has not the appropriate format.
Do you think that there is something wrong with the function of "formatoptions"?
I am unable to generate this issue and working fine with our demo (demos/integration/datepicker.php)
You can compare your code with it and re-check.
Alternate, you can email me complete code and database sample sql to generate test case here.
Hi,
Finally we did the following change in the code:
from
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'d/m/Y');
to
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'d-m-Y');
and it works now
As for your information the issue has been noticed by many users and it with the format date.
Unfortunately,i cannot provide db data according the company's policy but you need to have a lot of rows to test the issue with the dates.
Thanks a lot for your help!