title: Javascript Uncaught TypeError : .split is not a function
body: <p>I wanted to make a function where user can only claim coins once per day. 
  I did the  function <code>.split</code> so that it compares the date only since <code>Date()</code> only compares both date and time. However, i got this javascript error:</p>
  
  <blockquote>
    <p>Uncaught TypeError (intermediate value).split is not a function</p>
  </blockquote>
  
  <p>Anyone knows on how to solve this problem? I've tried so many ways. The error is still there.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$(document).ready(function () {
    if (new Date(model[0].lastClaimedDate).split(' ')[0] &lt; new Date().split(' ')[0]) {
      document.getElementById('btnAddCoins').disabled = false;
    }
    else {
      document.getElementById('btnAddCoins').disabled = true;
    }   
  })
  </code></pre>