I'm getting cards assigned to the user using the Trello API. It's an array called cards
. Each item in the array has another array nested inside it, with the properties of each card inside it.
So I have my cards
array, and then each Object inside it has it's own array.
E.g:
[Object, Object, Object]
0: Object
due: 2013-11-29T12:00:00.000Z
1: Object
due: 2013-11-26T12:00:00.000Z
2: Object
due: 2013-12-28T12:00:00.000Z
I want to sort my cards
by the due
property of the cards
.
I get this array like this:
Trello.get("members/me/cards", function(cards) {
console.log(cards);
});
And I can get each due
property with console.log(dates[1].due)
So my question is, how can I order these Objects by this datetime?