Format de date dans le package NGX-CSV en angulaire
getFile( )
{
const object : any = this.dataSource
const keys_to_keep = ['firstName', 'dateOfJoining'];
const key = object.map(e => {
e.dateOfJoining = moment(e.dateOfJoining).format('DD/MM/YYYY')
const obj = {};
keys_to_keep.forEach(k => obj[k] = e[k]
)
return obj;
});
var options =
{
fieldSeparator: ',',
quoteStrings: '"',
decimalseparator: '.',
showLabels: true,
showTitle: true,
title: '',
useBom: true,
noDownload: false,
headers: ["FirstName","DateOfJoining"]
};
new ngxCsv(key,"Title", options);
}
Bloody Beaver