moment.js template helpers for ember
- ember-cli < 0.2.3
ember install:addon ember-moment
- ember-cli >= 0.2.3
ember install ember-moment
advance
import { moment, ago } from 'ember-moment/computed';
export default Ember.Controller.extend({
date: new Date('2013-02-08T09:30:26'),
shortDate: moment('date', 'MM/DD/YYYY')
timeSince: ago('date', true)
});
You can optionally include the Moment Timezone package in your Brocfile.js
like so:
var app = new EmberApp({
'ember-moment': {
// moment-timezone dataset to include. Either 'all', '2010-2020', or 'none'.
'includeTimezone': 'all'
}
});
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.