my array is like this:

```
const myArr = [{text: 'Hello', created: '2018-05-22T08:56:42.491Z'}, {text: 'Hello', created: '2018-05-24T05:56:42.491Z'},]

```

with this kind of array, I want to sort them by newest and oldest, this is my current implementation which does not work:

```
if (sortFilter === 'oldest') {
      contactData = contactData.sort(({ created: prev }, { created: next }) => moment(prev).format('L') - moment(next).format('L'));
    } else if (sortFilter === 'newest') {
      contactData = contactData.sort(({ created: prev }, { created: next }) => moment(next).format('L') - moment(prev).format('L'));
    }

```

what's wrong with my code?