adopted-ember-addons/ember-moment

Feature Request: moment-range

hoIIer opened this issue · 2 comments

It would be great if this library contained a template helper to automatically create a range of dates using moment-range

@erichonkanen check this: jasonmit/ember-cli-moment-shim#163

Or alternative:
https://www.npmjs.com/package/ember-cli-cjs-transform
and https://www.npmjs.com/package/moment-range

ember-cli-build.js:

app.import('node_modules/moment-range/dist/moment-range.js',{
    using: [
        { transformation: 'cjs', as: 'moment-range'}
    ]
});

your-componen.js:

import momentRange from 'moment-range';
import momentTime from "moment";
const moment = momentRange.extendMoment(momentTime);
...
let range = moment.range(beginMoment, endMoment);
...