adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

Feature Request: moment-range #286

Closed hoIIer closed 6 years ago

hoIIer commented 6 years ago

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

willviles commented 6 years ago

@erichonkanen check this: https://github.com/jasonmit/ember-cli-moment-shim/pull/163

BenjaminBeck commented 5 years ago

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);
...