update csv export to include full date and time in 12 hour format (#5922)

* update csv export to include full date and time in 12 hour format

* formatting the export datetime to 24 hours
This commit is contained in:
Chukwuleta Tobechi
2024-04-15 04:21:56 +01:00
committed by GitHub
parent 893b92439c
commit d2e95c2246

View File

@@ -185,7 +185,7 @@ function downloadCSV() {
// Convert ISO8601 dates to YYYY-MM-DD HH:mm:ss so the CSV easily integrate with Excel
modifyFields(srv.result.fields, data, 'amount', displayValue)
modifyFields(srv.result.fields, data, 'datetime', v => v? moment(v).format('YYYY-MM-DD hh:mm:ss'): v);
modifyFields(srv.result.fields, data, 'datetime', v => v ? moment(v).format('YYYY-MM-DD HH:mm:ss') : v);
const csv = Papa.unparse({ fields: srv.result.fields.map(f => f.name), data });
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
saveAs(blob, "export.csv");