I want to create a Date object in TypeScript (AngularJS) from this string: 08:00:00.000+01:00 in order to use a filter in the end to show only the hour and the minute:
.filter('toDate', () => {
return input => {
let date = Date.parse(input);
return date;
}
})
In the HTML:
{{ object.unformatedTimeString | toDate | date: 'H:m' }}
Does anyone know a good way how to parse such a time string?
let [hr, min] = str.split(':');. Why the conversion?