I have data from a pandas dataframe that I want to put in a datatable. The first field is a date. It’s formatted YYYY-MM-DD in pandas. In the dataframe it’s format is YYYY-MM-DDT00:00:00. How do I get time out of the format in the dataframe? In all of the examples in the DataTable user guide dates are in YYYY-MM-DD format.
This worked properly in an earlier version of Dash and DataTable (I believe the version of Dash was 0.4).
According to https://dash.plotly.com/datatable/reference, columns.format is “derived from the d3-format library specification”, which doesn’t have any date-formatting functionality. So that definitely won’t work. If you change the date column of the DataFrame into a string with the format YYYY-MM-DD, before you send the DataFrame to the Datatable, then it will display correctly and sort correctly, because alphabetical order on the string is the same as chronological order.