I need to validate the date from the user and check if it is in a particular format. If yes, then it will be accepted else it will not be. I am looking for sort of
value.match("regular expression")
The above works fine if, I have to choose from few formats. So, I came across this moment.js and interested in knowing how to use isSame(). I tried implementing it but unsuccessful. Like :
var x=moment("MM/DD/YYYY") ;
x.isSame("28-02-1999"); // am getting false which is right
var x=moment("28-02-1999","DD-MM-YYYY") ;
x.isSame("28-02-1999"); // am getting false which is wrong
So, please help in that. Thanks