When initializing a new Date
instance in Chrome
, if the provided value is a partial date string (with no year set), Chrome
defaults the Year to 2001.
This behavior is different than other browsers such as Firefox
, which returns "Invalid Date"
in such case.
For example:
new Date('05/22')
will result to May 22, 2001
Is there any specific reason they use 2001 as the default year and not the current year? Is there any way to change this behavior?