Re:New Date("WTF") – How well do you know JavaScript's Date ...
by lukan on Saturday July 12, 2025 @05:59PM
(#44545555)
That's why I wrote, "validated"
And there can also be man in the middle attacks or whatever, the efforts you do for validation depends still on your task at hand. How critical an error would be.
But even for the most trivial tasks I would never think of passing some user strings to Date and expect to get a valid value.
It can be a bit belt and suspenders doing validation of specific forms but shit happens. It's much better to catch stuff before it's persisted on the back end or on disk.