title: Date function isn't working as expected
body: <p>I'm trying to insert the current year into a copyright statement and it's not working - likely because of something really basic. Any help? Thanks. :)</p>
  
  <p>ps If there are any other stylistic issues, I welcome all comments.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function ()
  {
    // Veterinary Calculator Code
    // define variables for body weight, dehydration and ongoing losses
    $bw = $('#bodyWeight');
    $dh = $('#dehydration');
    $ol = $('#ongoingLosses');
    //  update maint, replacement, dailyRequirement and rate when bw, dh or ol changes.
    function updateDetails()
    {
      var $dr = $('#dailyRequirement');
      var $repl = $('#replacement');
      var $rt = $('#rate');
      var ol = parseInt($ol.val());
      var mt = parseInt(1.5 * (70 * (Math.pow($bw.val(), 0.75)))); // maintenance requirement
      $dr.text(mt + ' ml/24 hours');
      var rep = parseInt($bw.val() * 10 * $dh.val()); // replacement amount
      $repl.text(rep + ' ml');
      var rt = parseInt((mt + rep + ol) / 24); // total fluid rate
      $rt.text(rt + ' ml/hr');
    }
    // add event listeners for input elements
  
    $bw.on('change', updateDetails);
    $dh.on('change', updateDetails);
    $ol.on('change', updateDetails);
    // Insert current year into copyright statement
    var dateNow = new Date();
    var thisYear = dateNow.getFullYear();
    var elYear = $('#currentYear');
    elYear.text = thisYear;
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;body&gt;
    &lt;div&gt;
     &lt;header&gt;
      &lt;h1&gt;Fluid Calculator&lt;/h1&gt;
     &lt;/header&gt;
     
  
     &lt;div&gt;
      &lt;fieldset id="params"&gt;
       &lt;legend&gt;Inputs&lt;/legend&gt;
       &lt;label&gt;Body Weight (kg):&lt;/label&gt;&lt;br /&gt;
       &lt;input type="number" id="bodyWeight" autofocus min="0" /&gt;
       &lt;br&gt;&lt;br /&gt;
       &lt;label&gt;% Dehydration:&lt;/label&gt;&lt;br /&gt;
       &lt;input type="number" id="dehydration"/&gt;
       &lt;br /&gt;&lt;br /&gt;
       &lt;label&gt;Ongoing Losses (ml):&lt;/label&gt;&lt;br /&gt;
       &lt;input type="number" id="ongoingLosses" /&gt;
       &lt;br /&gt;&lt;br /&gt;  
            
      &lt;/fieldset&gt;&lt;br /&gt;
  
      &lt;label&gt;Daily Requirement:&lt;/label&gt; &lt;label class="result" id="dailyRequirement"&gt;0 ml&lt;/label&gt; &lt;br /&gt;
      &lt;label&gt;Replacement:&lt;/label&gt; &lt;label class="result" id="replacement"&gt;0 ml&lt;/label&gt; &lt;br /&gt;
      
      
      &lt;br /&gt;
      &lt;label&gt; Rate (ml/hr):&lt;/label&gt; &lt;label class="result" id="rate"&gt;0 ml/hr&lt;/label&gt;
     &lt;/div&gt;
  
     &lt;footer&gt;
      &lt;p&gt;  
       &amp;copy; Copyright 2014-&lt;span id="currentYear"&gt;year&lt;/span&gt; by VETsharp Pty Ltd
      &lt;/p&gt;
     &lt;/footer&gt;
    &lt;/div&gt;
    &lt;script type="text/javascript" src="https://code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="vc.js"&gt;&lt;/script&gt;
    
   &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>