Ember-moment
moment.js template helpers for ember
Usage
- ember-cli < 0.2.3
ember install:addon ember-moment
- ember-cli >= 0.2.3
ember install ember-moment
{{moment date}}
{{ago date}}
{{duration ms}}
advance
{{moment date outputFormat inputFormat}}
{{ago date inputFormat}}
{{duration number units}}
ES6 Moment
This addon provides the ability to import moment as an ES6 module.
import moment from 'moment';
Computed Macro
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)
});
Include Moment Timezone
You can optionally include the Moment Timezone package in your config/environment.js
like so:
module.exports = function(environment) {
var ENV = {
moment: {
includeTimezone: 'all'
}
};
Development
Running Tests
ember test
ember test --server
Building
For more information on using ember-cli, visit http://www.ember-cli.com/.