title: MomentJS + VueJS: Getting Relative Time From Now To A Certain Point In The Past
body: <p>I use MomentJS.</p>
  
  <p>in my VueJS-Code I want to get the relative time from now to that point in the past. In my template I incorporate the result of this short piece of JavaScript:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;{{ moment(message.createdAt, 'YYYYMMDD').fromNow() }}&lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>the object receives the date as follows:</p>
  
  <pre><code>message: { createdAt: Date.now() }
  </code></pre>
  
  <p>the result is always: <code>a few seconds ago</code> ...</p>
  
  <p>how can I get the correct result (not always "a few seconds ago"):</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>this is my full template:</p>
  
  <pre><code>&lt;template v-for="message in messages"&gt;
    &lt;div class="message"&gt;
      &lt;div class="text"&gt;{{ message.text }}&lt;/div&gt;
      &lt;div class="date"&gt;{{ moment(message.createdAt).format('D.M.YYYY') }}&lt;/div&gt;
      &lt;div class="date"&gt;{{ moment(message.createdAt).fromNow() }}&lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>