How to use the ember-moment/computeds/moment function in ember-moment

To help you get started, we’ve selected a few ember-moment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coding-blocks / codingblocks.online.projectx / app / models / announcement.js View on Github external
import DS from 'ember-data';
import _moment from 'ember-moment/computeds/moment';
import fromNow from 'ember-moment/computeds/from-now';

export default DS.Model.extend ({
  title: DS.attr ("string"),
  text: DS.attr ("string"),
  createdAt: DS.attr (),
  updatedAt: DS.attr (),
  run: DS.belongsTo ('run'),
  user: DS.belongsTo ('user'),
  elapsedTime: fromNow (
    _moment ('createdAt'),
    false
  ),
});

ember-moment

Moment.js template helpers Ember.js

MIT
Latest version published 4 months ago

Package Health Score

67 / 100
Full package analysis