title: combine two javascript functions
body: <p>I've have been trying to fix this problem.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;h4&gt;Your Itinerary&lt;/h4&gt;
  &lt;div id="selected"&gt;&lt;/div&gt;
  &lt;script&gt;
      (function () {  
          $(".info-css").on(
              'click' 
          ,   function (e) {
                  $('#selected').html(
                      [
                          $('#start option:selected').text()                        
                      ,   $('#second option:selected').text()                       
                      ,   $("#datepicker").datepicker( "getDate" )
                      ,   $('#third option:selected').text()
                      ,   $("#datepicker2").datepicker( "getDate" )
                      ,   $('#forth option:selected').text()
                      ,   $("#datepicker3").datepicker( "getDate" )
                      ].join("&lt;br&gt; to ")
                  );
              }
          );
      }());
  &lt;/script&gt;
  </code></pre>
  
  <p>The code outputs something like this:</p>
  
  <pre><code>Your Itinerary
  
  Arenal / la Fortuna
  
  to Cahuita
  
  to Mon Mar 21 2016 00:00:00 GMT-0600 (Central Standard Time (Mexico))
  
  to Bocas del Toro (To/From Costa Rica)
  
  to Thu Mar 24 2016 00:00:00 GMT-0600 (Central Standard Time (Mexico))
  
  to Manzanillo
  
  to Thu Mar 31 2016 00:00:00 GMT-0600 (Central Standard Time (Mexico))
  </code></pre>
  
  <p>I'm trying to do two things:</p>
  
  <p>1) Have the <code>getDate</code> only show the <code>Mon Mar 21 2016</code> and not the time and everything else.</p>
  
  <p>2) Combine the</p>
  
  <pre><code>    $('#second option:selected').text()
  ,   $("#datepicker").datepicker( "getDate" )
  </code></pre>
  
  <p>into one string with <code>on</code> between the two.</p>
  
  <p>For Example:</p>
  
  <pre><code>Arenal / la Fortuna
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>Cahuita on Mon Mar 21 2016   
  </code></pre>
  
  <p>Here is a test page:</p>
  
  <p><a href="http://thecostaricatoursite.tcct-test.com/test/" rel="nofollow">http://thecostaricatoursite.tcct-test.com/test/</a></p>