When using the constructor Date() in Javascript, with a date that has backslashes on it, the Date the constructor returns "Invalid Date". For example: new Date("17/AUG/1996") Returns "Invalid Date" new Date("17-AUG-1996") Returns a valid date.
Could you please clarify why you expect this format to work? Does it work in other browsers?
Hello Alexey, the same format works in Google Chrome, Firefox and Edge when accessed from a Windows computer.
To quote MDN: "The ECMAScript specification states: If the String does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm. Unrecognizable strings or dates containing illegal element values in ISO formatted strings shall cause Date.parse() to return NaN." This means that WebKit could theoretically support these date formats. In my opinion though, it shouldn't. Especially with Temporal getting closer and closer to Stage 4, developers of any browser shouldn't focus on implementing support for niche unofficial date formats for the Date constructor, which is the part in the ECMAScript specification with the most fundamental flaws and design mistakes. Supporting stuff like "17/AUG/1996" is optional and not a MUST in the spec. Date is old and crappy. Don't do it.
<rdar://problem/94446483>