Ok, I found it.
According to the documentation ,
Starting with version 2.3.0, you can specify boolean for the last argument to force Moment to use strict parsing. Strict analysis requires that the format and input match exactly
because you are using a strict operation, it returns false . To overcome this use below code:
alert(moment("2011-10-10T14:48:00", "YYYY-MM-DDTHH:mm:ss", true).isValid()) //This will return true
demo1
If you remove strict parsing ,
alert(moment("2011-10-10T14:48:00", "YYYY-MM-DD").isValid()) //This will return true
demo2
Praveen
source share