ParamQuery grid support forum
General Category => Bug Report => Topic started by: omerix on July 21, 2023, 08:36:02 pm
-
Hello,
Some data comes from sql, json, xml in "2023-05-22T00:00:00" format. I have set colmodel datatype=date. I am doing Format:dd/mm/yyyy.
(+) The format changes in the grid.
(+) The format changes in the Print.
(+) The format changes in the html.
(+) It changes in csv, (-) but when exporting to excel, the data in the xlsx file is not the same. It comes as "2023-05-22T00:00:00".
-
Looking into it.
-
i have did it some other way please check below
eachCell:function(cell, ci, ri, column, rowData){
// get the orininal cell value;
cell["value"] = rowData[ column["dataIndx"] ];
// set date format to create date , out date, and return date
if([ "OUT_DATE", "RETURN_DATE"].includes(cell.dataIndx))
{
var date = empty(cell["value"]) ? false : moment(cell["value"]),
days = date ? date.diff("1900/01/01", "days")+2 : false,
converted = date ? days + ((date.second() + (date.minute()*60) + (date.hour()*60*60)) / 86400) : false;
cell["format"] = "dd/mm/yyy";
if(converted)
cell.value = converted;
}
}
Initially we can set all kind of formats through this
please if we can get better way to render dates and other formats, it will be very fine.....
-
This issue was fixed in v9.0.2