i have an art archive where my content collection includes two date props, the {date} it was created and the {uploadDate}. to sort them by {date}, i've written the following:
export function sortByDate(entries) {
const sortedEntries = [...entries];
sortedEntries.sort((a, b) => new Date(a) - new Date(b));
return sortedEntries;
}
i'm trying to write a separate function to sort them by {uploadDate} as well for a "recently added entries" scrollbox. how might i specify when writing the function that that is the prop i am trying to work with?