title: Days/Weeks ago from specific date with Moment.js
body: <p>I work with <strong>moment.js</strong> and I have 3 different dates, e.g.</p>
  
  <ul>
  <li>30.07.2018</li>
  <li>12.06.2018</li>
  <li>10.05.2018</li>
  </ul>
  
  <p>I now try to get the difference in days from these dates until today (if it is less then 7 days ago) or the weeks until today (if it more than 7 days ago) and place it in several spans.</p>
  
  <p><strong>UPDATE</strong> <em>thanks Thomas!</em></p>
  
  <p>I got:</p>
  
  <pre><code>$(document).ready(function(){
      $('.timestamp').html((index, html) =&gt; {
  
          let date = moment(html, "DD.MM.YYYY HH:mm", true), 
          now = moment(),
          days = Math.floor(Math.abs(date - now) / 86400000), 
          weeks = Math.floor(days/7),
          result = date.format("DD.MM.YYYY") + " - ";
  
        if(weeks){
          result += weeks + (weeks===1? " week ": " weeks ");
          days = days % 7;        
        }
  
        if(days || weeks===0){
          result += days + (days === 1? " day": " days");
        }
  
        return result;
      });
  
  });
  </code></pre>
  
  <p>What I still need:</p>
  
  <ul>
  <li><p>Not showing the initial date, just showing <code>"3 Days"</code>. If it delete "result", I want work anymore.</p></li>
  <li><p>Not showing <code>"7 weeks 2 days"</code>, this should just be <code>"7 weeks"</code></p></li>
  </ul>
  
  <p>Here is the actual <a href="http://jsfiddle.net/r289hvpL/16/" rel="noreferrer"><strong>fiddle</strong></a>.</p>