const data = [
{ time: '13:20', key2: '', key3: '' },
{ time: '13:40', key2: '', key3: '' },
{ time: '04:20', key2: '', key3: '' },
{ time: ' 4:25', key2: '', key3: '' },
{ time: '23:03', key2: '', key3: '' },
{ time: '14: 3', key2: '', key3: '' },
{ time: ' 2 ', key2: '', key3: '' },
];
const hourMinutes = str => /\s*(?<hh>\d*)\s*:?\s*(?<mm>\d*)\s*/.exec(str);
const toMinutes = ({ hh = 0, mm = 0 }) => (+hh) * 60 + (+mm);
const toTime = ({ time }) => toMinutes(hourMinutes(time).groups);
const ascending = [...data].sort((a, b) => toTime(a) - toTime(b));
const descending = [...data].sort((a, b) => toTime(b) - toTime(a));
console.log(JSON.stringify(ascending));
console.log(JSON.stringify(descending));