I use the below template to format the table cell, but when I export to csv, the csv data keep its original data, is it possible to export the template data to csv as this behaviour is not consistent between the look and the export.
<p-column field="end_time" header="end_time">
<template let-col let-row="rowData" pTemplate type="body">
<span>{{row[col.field] | date:"HH:mm:ss"}}</span>
</template>
</p-column>
I'd like this exact feature as well. Exporting dates to CSV is not human readable by default.
And export the header name instead the field's name
With 4.0.1 letting filters apply to CSV export, adding this would still be awesome
But we can't know what is inside templates so there is a technical limitation, will reopen if we can find a way.
Posted a working solution, which allows to export exactly what you see:
https://github.com/primefaces/primeng/issues/3552
Most helpful comment
And export the header name instead the field's name