I am using moment.js to parse a date. http://momentjs.com/docs/#/parsing/string-format/
This is to validate and convert the date to a format required by my database. In my testing I encountered this input date '6-4-3' which should not be valid with the given format.
moment('6-4-3','YYYY-MM-DD',true).isValid(); //returns true
The resulting date in the moment object is "Mon Apr 03 0006 ...". When I call isValid, it returns true. I think it should consider this date invalid because it has too few digits in the input for each part of the format string.
I added a regex.test in my code to ensure that the dates have the right number of digits, but I think this should be handled differently in moment.js when strict is true.
Is there something I'm missing here? Isn't this the point of strict parsing? Or is there a reason why this is the intended behavior?