I have a DataTable, as listed below:
<DataTable
:rows = "5"
:value = "apiItems"
>
<Column
:field="initialDate"
:header="Initial Date"
:sortable="true"
/>
<Column
:field="finishDate"
:header="Finish Date"
:sortable="true"
/>
</DataTable>
initialDate and finishDate are both data fields that are pulled from an API call, and will look something like this: "08/21/2022 11:43:12"
When I attempt to sort these columns, they do not sort by the actual date (which is what I need), but just the first number in the string (which is the month)
WHAT IT DOES:
Ascending:
"08/22/2021 11:43:12"
"07/01/2022 12:01:09"
WHAT I NEED:
Ascending:
"07/01/2022 12:01:09"
"08/22/2021 11:43:12"
WHAT I'VE TRIED: Attempted to turn the already present date into a JS Data object as such: new Date(initialDate).toLocaleString(). Doesn't sort properly still.
Thanks for the Assistance.