There are many models in an array. now you need to put the model.date date on the same day into an array?

  ios, question

There is a model in an array, like this:
[

model1.date = 2016.4.12 8:25
 model2.date = 2016.4.12 9:20
 model3.date = 2016.3.13 8:30
 model4.date = 2016.3.11 8:15
 model5.date = 2015.2.12 1:20
 model6.date = 2015.2.12 2:25

bracket

What needs to be done now is to put those with the same date into an array and those without the same date into an array. The final array to be obtained should look like this:
[

[model1,model2],
 [model3],
 [model4],
 [model5,model6],

bracket
Excuse me, how should I do it?

Is this json? Direct
var keymap={};
Then walk through this list.
Determines whether keymap[item.date] is undefined.
Yes, it is assigned to an array
No, just push the iteminto it.
Finally, it traverses a keymap and pushes all values into a list.