Following is the scenario:
I have a String date and a date format which is different. Ex.:
date: 2016-10-19
dateFormat: \"DD-MM-YYYY\".
Was able to find the solution. Since the date I am getting is in ISO format, only providing date to moment will validate it, no need to pass the dateFormat.
var date = moment("2016-10-19");
And then date.isValid() gives desired result.
I just found a really messed up case.
moment('Decimal128', 'YYYY-MM-DD').isValid() // true
Try this one. It is not nice but it will work as long as the input is constant format from your date picker.
It is badDate coming from your picker in this example
https://jsfiddle.net/xs8tvox9/
var dateFormat = 'DD-MM-YYYY'
var badDate = "2016-10-19";
var splittedDate = badDate.split('-');
if (splittedDate.length == 3) {
var d = moment(splittedDate[2]+"-"+splittedDate[1]+"-"+splittedDate[0], dateFormat);
alert(d.isValid())
} else {
//incorrectFormat
}