title: Determine if date is weekend or weekday
body: <p>So I have an input field where you select a date by clicking on a calendar and then that date is filled into a field. </p>
  
  <pre><code>&lt;input type="text" name="date" value="" class="form-control datepicker" disabled=""&gt;
  </code></pre>
  
  <p>This field is filled when a visitor clicks on the date on a calendar, the date is then passed through to the field above using javascript. </p>
  
  <pre><code>$("td").click(function(){
     var day =  $(this).find(".day").html();
     $(".datepicker").val("&lt;?php echo $this-&gt;uri-&gt;segment('3'); ?&gt;/"+day+"/&lt;?php echo $this-&gt;uri-&gt;segment('2'); ?&gt;");
  });
  </code></pre>
  
  <p>To create a <code>value</code> of something like this for example <code>07/14/2014</code></p>
  
  <p>Then I have a drop down with a certain set of times. This is the Weekday Time Schedule: </p>
  
  <pre><code>&lt;select name="time" class="form-control"&gt;
     &lt;option value="4:30 PM"&gt;4:30 PM&lt;/option&gt;
     &lt;option value="5:30 PM"&gt;5:30 PM&lt;/option&gt;
     &lt;option value="6:30 PM"&gt;6:30 PM&lt;/option&gt;
     &lt;option value="7:30 PM"&gt;7:30 PM&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I have a different time frame set for weekends. But I currently have no way to distinguish between what days are weekdays and what days are weekends in the date field. </p>
  
  <p>I am using codeigniter to generate the calendar and the form. So my dropdown looks like this: </p>
  
  <pre><code>&lt;?php echo form_dropdown('time', $week_times, '', 'class="form-control"'); ?&gt;
  </code></pre>
  
  <p>$week_times need to be converted into an if statement, something like the below so that I can provide two different sets of times based on what day of the week the day falls on for that month. </p>
  
  <pre><code>if(date == weekday){
     $times = $week_times;
  }
  elseif(date == weekend){
     $times = $week_end_times;
  }
  </code></pre>
  
     
  
  <p>Obviosuly, that isn't a real if statement, but if I had that I wouldn't be asking the question <b>How can I tell if a date field is a weekday or weekend and choose an array based off that information?</b></p>