Validation fails for valid input with textual months followed by period (MMM. and MMMM.)
See original GitHub issueDescribe the bug
In our date field, formats including MMM and MMMM cause the dayjs(value, format, strict=true).isValid() to return false for all values.

Expected behavior
IsValid() should return true
Information
- Day.js Version: dayjs@^1.10.6: version “1.11.3”
- OS: Windows 10
- Browser: Chrome
- Time zone: GMT+2 - Central European Summer Time
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Laravel date_format Validation Fails on Textual Month
Laravel fails on date_format validation. The month does not match the format M Y. I have tried all PHP date formats from here...
Read more >Date Input validation in a text box - Power Platform Community
my query here is I need to validate the input given by the user and show a popup to User to type date...
Read more ><input type="month"> - HTML: HyperText Markup Language
The value is a string whose value is in the format " YYYY-MM ", where YYYY is the four-digit year and MM is...
Read more >4.4. Validate Traditional Date Formats - O'Reilly
You want to validate dates in the traditional formats mm/dd/yy, ... You want to use a simple regex that simply checks whether the...
Read more >Form Validation: Date and Time < JavaScript | The Art of Web
In this example, the date fields will only accept input that matches the pattern 'dd/mm/yyyy' (this could just as easily be changed to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve made some tests and the issue could be easily fixed by adding a dot to the regex of matchWord (line 12 in customParseFormat.js). The line should be:
const matchWord = /\d*[^-_:/.,()\s\d]+/0.But there is a problem with this solution: unluckily the definitions for
monthsShortin the locale definition files are not consistent. Some have a dot at the end, some not; I think that is the reason, why until now the dot is not part of the matchWord regex.The customization example in the documentation does not have a dot after the monthShort so this looks like a recommendation to me.
There are a few issues concerning the parsing of dots, so perhaps it would be a good idea to make this change. But then we have to remove the dot from the monthShort in all locales (or remove the trailing dot by code in the function
getLocalePartin ‘customParseFormat.js’ what would be my recommendation).This is a decision to be made by @iamkun.
aah, you got it; the dot is handled by dayjs parsing as a format token and not as a ‘separator’.
At the moment I cannot test it on my sytem, so would you please try, if the dot in the format string can be escaped (surrounded by square brackets)?