title: check date against an array of dates
body: <p>I am trying to write a function that returns a TRUE or FALSE value based on whether the date is present in the array or not. Currently I have this:</p>
  
  <pre><code>function isInArray(value, array) {
      var a = array.indexOf(value) &gt; -1;
  
      if (a == false) {
          return false; //DATE DOES NOT EXIST
      }
      else {
          return true; //DATE EXISTS IN ARRAY
      }
  }
  </code></pre>
  
  <p>Now normally I would use a for loop, however I am generating a list of dates between a start date and end date with this while loop:</p>
  
  <pre><code> while (day &gt; 0) {
       var tDate = new Date(sDate.addDays(dayCounter));
       datesArray.push(tDate);
       day = day - 1; //DEDUCT THE DAYS AS ADDED
  
       var dateExists = isInArray(value, array);
       if (dateExists == false) {
  
       }
       else { 
           matchedDays++;
       }
       daysCounter++;
  }
  </code></pre>
  
  <p>this however is not working and always returns FALSE, what do I need to do to make this work and return the correct value?</p>
  
  <p>sample data: <code>ARRAY[26/12/2016, 27/12/2016, 28/12/2016, 29/12/2016]</code></p>
  
  <p>value passed in <code>[27/12/2016]</code></p>
  
  <ul>
  <li>return TRUE  if the value exists in the array</li>
  <li>return FALSE if the value does not exist in the array</li>
  </ul>
  
  <p>probably a simple mistake above! so thankyou for any help on this. also will a time affect the date when its being checked?</p>