That looks like you have an issue server side with whatever is providing your data, for consistencies sake i would recommend fixing it there, but if that is not possible then you have two options.
Mutator
If you want to alter the data in the table so it can be exported in a different format, you can set a data mutator on a column to map this data to something more usable.
In this example lets assume it is the date field that you are using, we will create a custom mutator and then in the column definition for that column assign the mutator:
//define custom mutator
var dateMutator = function(value, data, type, params, component){
//value - original value of the cell
//data - the data for the row
//type - the type of mutation occurring (data|edit)
//params - the mutatorParams object from the column definition
//component - when the "type" argument is "edit", this contains the cell component for the edited cell, otherwise it is the column component for the column
//convert date to JS date object
var d = new Date(0); // The 0 there is the key, which sets the date to the epoch
d.setUTCSeconds(value);
//format date to YYYY-MM-DD
var month = '' + (d.getMonth() + 1);
var day = '' + d.getDate();
var year = d.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
}
//column definition
{title:"Date", field:"date", mutatorData:dateMutator}
More information on mutators can be found in the Mutator Documentation
Formatter
If you want to keep the underlying data as it is but just display it differently to the user then you want to use a formatter.
The code for this is pretty similar to the mutator, again we will define a custom function and then bind it to the column in the column definition
//define custom formatter
var dateFormatter = function(cell, formatterParams, onRendered)
//cell - the cell component
//formatterParams - parameters set for the column
//onRendered - function to call when the formatter has been rendered
//convert date to JS date object
var d = new Date(0); // The 0 there is the key, which sets the date to the epoch
d.setUTCSeconds(cell.getValue());
//format date to YYYY-MM-DD
var month = '' + (d.getMonth() + 1);
var day = '' + d.getDate();
var year = d.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
}
//column definition
{title:"Date", field:"date", formatter:dateFormatter}
More information on formatters can be found in the Formatter Documentation
"2018-12-12"i can even work with that .. I've tried to add a function but it seems to be ignoring it all togethersorter: ()=>{ console.log(obj); if(obj != "birthdayDate"){"date"}else { "string" }},i'm saying it has ignored it as i see nothing in the console. - LoopingDev