While using Angular 12 I have a date as a string in a very custom format, from which I need to produce a Date object. An example of the date strings I have are:
20280328
20271201
To the human eye, these are obviously in the format yyyyMMdd
however none of the standard parse functions appear to understand this (not unexpected.)
Other than simply breaking the string using substring, is there a better way to interpret these strings into a Date object?
I was hoping to be able to provide a custom input format for the .parse()
function, but this does not appear to be available.