title: Javascript date comparison issues with datejs
body: <p>I have a date object, but the isAfter function in the API of datejs is not working. I opened the js library and cannot find any mention of it in there. I downloaded the latest version from dateJS site. Can anyone advise? Is there another method I should be using?</p>
  
  <p>I am basically trying to compare a date to the current date, and see if it is less than 1 min before, less than 1hr before, less than 1 day before etc.</p>
  
  <p>My code is:</p>
  
  <pre><code>function GetCleverDateString(date) {
  
      // Just a moment ago &lt;1 min
      // X minutes ago
      // X hours ago
      // Yesterday
      alert(date.toString()); // date is constructed via new Date(...); this alerts the full date string 
  
      var theDate = new Date(date.toString()); // was experimenting
  
      if (theDate.isAfter(Date.today().addMinutes(-1)))
      {
          return 'Just now';
      }
  
      if (theDate.isAfter(Date.today().addHours(-1)))
      {
          return 'Less than an hour ago';
      }
  
  
  }
  </code></pre>
  
  <p>I notice the version in their SVN has these methods. Perhaps I can get that? I don't know how though.</p>