Can anyone help me create a function that formats a date string for sorting in a table?
The date is in the format: 08.04.2022 16.54
I need to convert this to a number or date format that can be sorted.
I'm new to TypeScript and could use some guidance.
time = new Date();
logName(task: Emply) {
const REGEX_MATCH_DOTS_AND_WHITESPACE = /[\s\.]/
const [day, month, year, hour, minutes] = date.split(REGEX_MATCH_DOTS_AND_WHITESPACE)
return new Date(year, month, day, hour, minutes);
}
export interface Emply {
time: string;
}