Closed elliotching closed 7 months ago
您的邮件已收到,我会尽快给您回复。
The ddd
at the start of the format string is looking for a day name. Since day names can be any string based on locale, I suspect it's treating "Friendly" as the name, then moving on to look for the other parts of the date. It doesn't find any and uses lenient fallbacks.
Trying to parse it without the format string, or with different format strings, produces the expected result:
moment("Friendly").toString(); // 'Invalid Date'
moment("Friendly", "YYYY").toString(); // 'Invalid Date'
moment("Friendly", "MMM DD, YYYY").toString(); // 'Invalid Date'
Environment
For bug reports, please run the following code in your environment and include the output:
Issue description
A word "Friendly" is being false positively recognised as valid date, which should not be the case.
Expected Output