ember-cli-moment-shim
ember-cli ES6 module shim for momentjs and moment timezone within your Ember applications. It will also conditionally bundle in specific locale/timezone data for those concerned about payload size.
Usage
ember install ember-cli-moment-shim
;
Features
- ES6 accessible module for moment
- Trim your build sizes by bundling locale & timezone data through simple configuration
- FastBoot support
Enabling moment-timezone
// config.environment.jsmodule { return moment: // Options: // 'all' - all years, all timezones // 'subset' - subset of the timezone data to cover 2010-2020 (or 2012-2022 as of 0.5.12). all timezones. // 'none' - no data, just timezone API includeTimezone: 'all' ;}
i18n support
Cherry pick locales (optimal)
// config.environment.jsmodule { return moment: // To cherry-pick specific locale support into your application. // Full list of locales: https://github.com/moment/moment/tree/master/locale includeLocales: 'es' 'fr-ca' ;
NOTE: English is bundled automatically – no need to add en
in includeLocales
Include all locales
// config.environment.jsmodule { return moment: includeLocales: true ;
Configure default runtime locale
// app/routes/applicaton.js; Route;
dist
Write all locales to a folder that is relative to // config.environment.jsmodule { return moment: // This will output _all_ locale scripts to assets/moment-locales // this option does not respect includeLocales localeOutputPath: 'assets/moment-locales' ;
The feature set for i18n support within moment can be found here: http://momentjs.com/docs/#/i18n/
License
ember-cli-moment-shim shims is MIT Licensed.