I need to create a function to make a% custom% in a ordeBy
, but I can not think logic that I should use to perform the sort.
The requirement of sorting the list is as follows:
Resources must be displayed in ascending order of the date of presentation. Challenges must be displayed below the appeal associated in ascending order of the date of presentation.
Here is an example array, where the association between Resources and Challenges is given by the Number field:
[{
'numero': '1',
'dataApresentacao': '2016-01-26T00:00:00-02:00',
'tipo': 'RECURSO'
}, {
'numero': '2',
'dataApresentacao': '2016-01-26T00:00:00-02:00',
'tipo': 'RECURSO'
}, {
'numero': '3',
'dataApresentacao': '2016-01-28T00:00:00-02:00',
'tipo': 'RECURSO'
}, {
'numero': '1',<br>
'dataApresentacao': '2016-01-28T00:00:00-02:00',
'tipo': 'IMPUGNACAO'
}, {
'numero': '4',
'dataApresentacao': '2016-01-27T00:00:00-02:00',
'tipo': 'RECURSO'
}, {
'numero': '1',
'dataApresentacao': '2016-01-29T00:00:00-02:00',
'tipo': 'IMPUGNACAO'
}, {
'numero': '2',
'dataApresentacao': '2016-01-29T00:00:00-02:00',
'tipo': 'IMPUGNACAO'
}]
Any ideas?