All Projects → jasonmit → Ember Cli Moment Shim

jasonmit / Ember Cli Moment Shim

Licence: mit
ember-cli shim for momentjs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ember Cli Moment Shim

Ember Intl
Localization library for any Ember Application or Addon
Stars: ✭ 412 (+1111.76%)
Mutual labels:  ember-addon
Ember Data Table
Data tables for Ember following Google Design specs
Stars: ✭ 19 (-44.12%)
Mutual labels:  ember-addon
Ember Polymer
Use Polymer in your ambitious Ember application! 💎
Stars: ✭ 20 (-41.18%)
Mutual labels:  ember-addon
Ember Bootstrap
Ember-cli addon for using Bootstrap as native Ember components.
Stars: ✭ 475 (+1297.06%)
Mutual labels:  ember-addon
Ember Flexberry Data
OData v4 for EmberJS, JS Query Language, Offline, Data projections
Stars: ✭ 6 (-82.35%)
Mutual labels:  ember-addon
Ember Highlight
Highlight a given term(s) inside the `{{highlight-terms}}` component block.
Stars: ✭ 10 (-70.59%)
Mutual labels:  ember-addon
Twix.js
⌛️↔️ A date range plugin for moment.js
Stars: ✭ 374 (+1000%)
Mutual labels:  moment
Emptyd Admin Webpack
基于typescript react webpack的脚手架
Stars: ✭ 30 (-11.76%)
Mutual labels:  moment
Moment.php
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
Stars: ✭ 900 (+2547.06%)
Mutual labels:  moment
Ember Paper
The Ember approach to Material Design.
Stars: ✭ 871 (+2461.76%)
Mutual labels:  ember-addon
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (+1476.47%)
Mutual labels:  moment
React Article Bucket
总结,积累,分享,传播JavaScript各模块核心知识点文章全集,欢迎star,issue(勿fork,内容可能随时修改)。webpack核心内容部分请查看专栏: https://github.com/liangklfangl/webpack-core-usage
Stars: ✭ 750 (+2105.88%)
Mutual labels:  moment
Ember I18n Changeset Validations
ember-i18n support for ember-changeset-validations messages
Stars: ✭ 11 (-67.65%)
Mutual labels:  ember-addon
Ember Cp Validations
Ember computed property based validations
Stars: ✭ 442 (+1200%)
Mutual labels:  ember-addon
Dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
Stars: ✭ 37,373 (+109820.59%)
Mutual labels:  moment
Date Io
Abstraction over common javascript date management libraries
Stars: ✭ 382 (+1023.53%)
Mutual labels:  moment
Ember Cli Scss Lint
An ember-cli addon to integrate sass-lint for standards adherence and improved style consistency
Stars: ✭ 7 (-79.41%)
Mutual labels:  ember-addon
Moment
一瞬,记录美好瞬间。
Stars: ✭ 31 (-8.82%)
Mutual labels:  moment
Ember Accessibility
An EmberJS addon to help identify accessibility violations during development
Stars: ✭ 29 (-14.71%)
Mutual labels:  ember-addon
Ember Api Feature Flags
API based, read-only feature flags for Ember
Stars: ✭ 11 (-67.65%)
Mutual labels:  ember-addon

ember-cli-moment-shim

Build Status npm Version Ember Observer Score

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
import moment from 'moment';

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.js
module.exports = function(environment) {
  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.js
module.exports = function(environment) {
  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.js
module.exports = function(environment) {
  return {
    moment: {
      includeLocales: true
    }
  };

Configure default runtime locale

// app/routes/applicaton.js
import moment from 'moment';

export default Ember.Route.extend({
  beforeModel() {
    // sets the application locale to Spanish
    moment.locale('es');
  }
});

Write all locales to a folder that is relative to dist

// config/environment.js
module.exports = function(environment) {
  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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].