title: using moment.js with Meteor to write days / hours / months past
body: <p>I'm using <a href="http://momentjs.com/docs/#/displaying/fromnow/" rel="nofollow">http://momentjs.com/docs/#/displaying/fromnow/</a> in a Meteor project...
  (package: <a href="https://atmospherejs.com/mrt/moment" rel="nofollow">https://atmospherejs.com/mrt/moment</a>)</p>
  
  <p>I want to write out something like</p>
  
  <ul>
  <li>"User: jsmith  <strong>joined 4 years ago</strong>"</li>
  </ul>
  
  <p>I must be missing a conversion from mongoDB dates to moment?</p>
  
  <p>json object mongo</p>
  
  <pre><code>{
  "_id" : "vWM5Sg67fqxQAzrnv",
  "createdAt" : ISODate("2015-03-14T03:39:03.384Z"),
  "emails" : [
  {... etc.
  </code></pre>
  
  <p>When I type this into console</p>
  
  <pre><code>Meteor.user().createdAt;
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>Mon Mar 16 2015 14:11:54 GMT-0400 (EDT)
  </code></pre>
  
  <p>In my test.js file
  this works</p>
  
  <pre><code>var d= new Date('2011-04-11')
  var dd= moment(d).format('MM/DD/YYYY');
  console.log (dd);  // returns 04/10/2011
  </code></pre>
  
  <p>this works</p>
  
  <pre><code>var dd  = moment([1954, 5, 8]).fromNow(true); // 4 years
  console.log (dd);
  </code></pre>
  
  <p>returns 61 years</p>
  
  <pre><code>this **DOESN'T** work
  
  d = Meteor.user().createdAt;
  var dd= moment([d]).fromNow(true);
  console.log (dd);
  </code></pre>
  
  <p>returns TypeError: undefined is not an object (evaluating 
  Meteor.user().createdAt')</p>
  
  <p><strong>Any help would be appreciated, been trying a while..</strong></p>
  
  <p>Note: in my template</p>
  
  <pre><code>{{currentUser.createdAt}}
  </code></pre>
  
  <p>does works (i.e. been published)</p>
  
  <p>Rob</p>