title: javascript date validation using date object
body: <p>According to <a href="http://www.codingforums.com/archive/index.php/t-98569.html" rel="nofollow">http://www.codingforums.com/archive/index.php/t-98569.html</a>, the date validation could be done using the javascript's date object. </p>
  
  <p>I've a similar scenario, where I have individual year,month,date in seperate text boxes which get validated by regular expressions.Now I would like to leverage the JS's date object to check stuff like days in a month and leap year validation which are not done by RegExp validation. But the stuff discussed in the above link doesn't quite work for me.
  For example,</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     var dy= new Date(2001,2,30);
     alert(dy.getFullYear()+" "+dy.getMonth()+" "+dy.getDate());
  &lt;/script&gt;
  </code></pre>
  
  <p>returns the date as it is. Shouldn't dy.getMonth() return something like -1 to show that 30 days doesn't exist in the month of February?. If this isn't possible using Date object, please suggest some alternatives to validate the date.</p>
  
  <p>Update:
  I just found another link(http://internotredici.com/article/checkdateinjavascript/) which says the same.
  PS:I am working on JS1.2 which is pretty old.</p>