Normally, you would require something like:
/** ...somewhere inside a method of your component
* but it is always better to keep such functions in a services folder
* you could not only need it elsewhere, but at the same time, it maintains the purpose
* of your component too. */
// assuming you want it in ascending order
this.items.sort((a, b) => {
if (Date.parse(a.date) > Date.parse(b.date)) {
return 1
} else if (Date.parse(a.date) < Date.parse(b.date)) {
return -1
} else {
return 0
}
})
But this won't work in your case as your format is not as per the Date.parse spec which will link you to the date-time ISO 8601 formats here
quick note:
new Date('25.03.1980') // Invalid Date (Throws an error if your date is incorrect)
Date.parse('25.03.1980') // NaN, using (Date.parse will not throw error!)
So, if possible you would need to change your format, or else use a library, I recommend momentjs.