title: isSame() function in moment.js or Date Validation
body: <p>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 </p>
  
  <pre><code>value.match("regular expression") 
  </code></pre>
  
  <p>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 :</p>
  
  <pre><code>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
  </code></pre>
  
  <p>So, please help in that.
  Thanks</p>