title: how to check time range in javascript
body: <p>i have start and end time along with date.like this</p>
  
  <pre><code>         stime:1pm , etime:2pm , date:2/6/2013
  </code></pre>
  
  <p>i want to store this start and end time and date into mongodb. so before saving this details </p>
  
  <p>, i should  check within this date, this time range is exist or not</p>
  
  <p>so how to do that in javascript. how to check time range already exist or not?</p>
  
  <p>i have tried like this.but it is not working properly. even i don't know my approach ,whether right or wrong ? </p>
  
  <p>i hope that anyone help me to find solution for this. </p>
  
  <pre><code>   var d0 = new Date("01/01/2001 " + "8:30 AM");
     var d1 = new Date("01/01/2001 " + "9:00 PM");
     var d2 = new Date("01/01/2001 " + "8:30 AM");
    var d3 = new Date("01/01/2001 " + "9:00 PM");
   if(d2&lt;d0&amp;&amp;d3&lt;=d0||d2&lt;d1&amp;&amp;d3&lt;=d3)
   {
        console.log("available");
   }else{
       console.log("not available");
   }
  </code></pre>