title: Check if a date within in range
body: <p>I am trying to check if a date of format mm.dd.yyyy is greater than today and less than the date after 6 months from today.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var isLinkExpiryDateWithinRange = function(value) {
      var monthfield = value.split('.')[0];
      var dayfield = value.split('.')[1];
      var yearfield = value.split('.')[2];
      var inputDate = new Date(yearfield, monthfield - 1, dayfield);
      var today = new Date();     
      today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
      alert(inputDate &gt; today);//alert-&gt; true
      var endDate = today;
      endDate.setMonth(endDate.getMonth() + 6);
      alert(inputDate &gt; today);//alert-&gt; false
      if(inputDate &gt; today &amp;&amp; inputDate &lt; endDate) {
          alert('1');
      } else {
          alert('2');/always alert it
      }
  }
  </code></pre>
  
  <p>If I execute <code>isLinkExpiryDateWithinRange('12.08.2012')</code> I wish it will show 1 as this is within the range, but it is displaying 2. Moreover the first alert is showing true and the second one false. </p>
  
  <p>Can anyone please explain what is happening?</p>