You are right, it is a relatively minor tripping hazard. JS has lots of those. But it is one that I tripped over recently. :)
The unexpected behavior is that simply changing the separator character changes the result. Most of the time, users will consider common date separators like hyphen and slash interchangeable. Now I have to either write extra code to remediate that expectation or confuse users when it does not work as expected (bad UX, and a non-option).
Also, my locale does not use that date notation. I would be surprised if JS Date parsing took locale into consideration.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are right, it is a relatively minor tripping hazard. JS has lots of those. But it is one that I tripped over recently. :)
The unexpected behavior is that simply changing the separator character changes the result. Most of the time, users will consider common date separators like hyphen and slash interchangeable. Now I have to either write extra code to remediate that expectation or confuse users when it does not work as expected (bad UX, and a non-option).
Also, my locale does not use that date notation. I would be surprised if JS Date parsing took locale into consideration.