I have searched for this question and no existing answer seems to apply. Consider the following:
[
{ 'August 17th 2016': [75] }, // 75 is the length of the array which contains up to 75 objects ...
{ 'August 1st 2016': [5] },
{ 'August 28th 2016': [5] },
...
]
What is the best way to sort the objects in this array by their date and still keep the "english" representation of their key?
Note: The key is used as a chart label.
Everywhere I look array.sort
is used, but that's on the object's key of say created_at
.
The result should be:
[
{ 'August 1st 2016': [5] },
{ 'August 17th 2016': [75] }
{ 'August 28th 2016': [5] },
...
]
I am not sure how to proceed so I don't have anything to show.