I have this object in my project. The keys within this object are dates. I'm trying to sort by chronological order. So for example:
//unordered
var mod = {
01-01-2019: { },
03-03-2018: { },
12-01-2017: { }
}
//ordered
mod = {
12-01-2017: { },
03-03-2018: { },
01-01-2019: { }
}
I've tried .sort()
but it's sorting by the month first. Any help would be appreciated.
*EDIT - I attempted to use the sort() routine, but with no luck of ordering it chronologically, is there a better way of sorting by date with the sort functionality?