I am using a PrimeVue DataTable () with the following structure:
<DataTable
:rows = "5"
:value = "apiItems"
>
<Column
v-for="data in columns"
:field="data.field"
:header="data.header"
:key="data.field"
:sortable="true"
/>
</DataTable>
The table is populated with data fetched from an API call, and the field layout is as follows:
const columns = [
{ field: 'initialDate', header: 'Initial Date'},
{ field: 'finishDate', header: 'Finish Date'}
];
The data retrieved from the API is in the format of a JS Date() component displayed as: "08/01/2022 08:33:32" for both initialDate and finishDate.
My concern is how to sort the columns in ascending or descending order based on both the date AND time stamps. Currently, when sorting, the columns are rearranged based only on the first digits (month), but I need them to be sorted taking into account not just the month but also the time.
Any assistance would be highly appreciated. Thank you.