Date objects should be able to be constructed with strings formatted as YYYY-MM-DD .
On Chrome-based browsers, both of the following are valid:
new Date("2022-06-01")
new Date("2022-6-01")
although the second one does not strictly follow the format. However, it is extremely convenient to work with since you do not have to check for the string length and determine whether to add a 0 in the beginning.
Yet, on my Safari browser, the code:
new Date("2022-6-01")
returns a date object of an invalid date. This is simple to fix, yet it poses an inconvenience during development. Is there any way to let Apple improve its JavaScript engine?