title: The custom date function works funky sometime
body: <p>I'm using the below script to custom my date, sometimes when the time is less than minute it works funky like that.</p>
  
  <p>How can i custom it to say 1 min ago if the date is less than a minute? or simply remove the seconds ago functionality?</p>
  
  <blockquote>
    <p>-9236 seconds ago</p>
  </blockquote>
  
  <pre><code>function dateFormatter(date) {
  
      var seconds = Math.floor((new Date() - date) / 1000);
  
      var interval = Math.floor(seconds / 31536000);
  
      if (interval &gt; 1) {
          return interval + " Years Ago ";
      }
      interval = Math.floor(seconds / 2592000);
      if (interval &gt; 1) {
          return interval + " Months Ago ";
      }
      interval = Math.floor(seconds / 86400);
      if (interval &gt; 1) {
          return interval + " Days Ago ";
      }
      interval = Math.floor(seconds / 3600);
      if (interval &gt; 1) {
          return interval + " Hrs ago ";
      }
      interval = Math.floor(seconds / 60);
      if (interval &gt; 1) {
          return interval + " mins ago ";
      }
      return Math.floor(seconds) + " seconds ago";
  }
  </code></pre>