I am exporting ag-grid
data to excel which has few date
type columns. On opening exported file, I observed that date
type columns are not auto-formatted to 'Date' format when exported from IE
. Same thing works fine in Chrome
.Below is the code which formats the date string -
exportData: function() {
var vm = this;
var params = {
fileName : vm.pageTitle + '.csv',
processCellCallback : function(params) {
if (params.value) {
if(params.column.colId === "endDate" || params.column.colId === "startDate"){
return params.value.toLocaleDateString();
}
}
return params.value;
}
};
vm.gridOptions.api.exportDataAsCsv(params);
}
Below is the excel screenshot for IE - The General format should be Date
Thanks in advance for any help.