How can I get the format string of a given date string in JavaScript/TypeScript?
Some examples:
getFormatOfDateString('30/05/1978 02:34:56')
// Should result in: 'dd/MM/yyyy HH:mm:ss'
getFormatOfDateString('Tuesday, August 20, 2002')
// Should result in: 'dddd, MMMM dd, yyyy'
getFormatOfDateString('Wed, Aug 31 1994')
// Should result in: 'ddd, MMM dd yyyy'