ember-moment
Advanced tools
Comparing version 1.1.1 to 1.2.1
@@ -15,7 +15,5 @@ { | ||
"moment": "~2.8.4", | ||
"moment-timezone": "~0.2.5", | ||
"qunit": "~1.17.1" | ||
}, | ||
"devDependencies": { | ||
"moment-timezone": "~0.2.5" | ||
} | ||
} |
20
index.js
@@ -14,2 +14,3 @@ 'use strict'; | ||
this.app = app; | ||
var options = app.options['ember-moment'] || {}; | ||
@@ -20,2 +21,21 @@ this._super.included(app); | ||
if (options.includeTimezone) { | ||
var timezonePath = "/moment-timezone/"; | ||
switch(options.includeTimezone) { | ||
case 'all': | ||
timezonePath += 'builds/moment-timezone-with-data'; | ||
break; | ||
case '2010-2020': | ||
timezonePath += 'builds/moment-timezone-with-data-2010-2020'; | ||
break; | ||
case 'none': | ||
timezonePath += 'moment-timezone'; | ||
break; | ||
default: | ||
throw new Error("Ember Moment: Please specify the moment-timezone dataset to include as either 'all', '2010-2020', or 'none'."); | ||
break; | ||
} | ||
app.import(app.bowerDirectory + timezonePath + '.js'); | ||
} | ||
app.import(app.bowerDirectory + '/ember-cli-moment-shim/moment-shim.js', { | ||
@@ -22,0 +42,0 @@ exports: { |
{ | ||
"name": "ember-moment", | ||
"version": "1.1.1", | ||
"version": "1.2.1", | ||
"description": "Moment.js template helpers for ember", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -7,3 +7,4 @@ # Ember-moment | ||
* `ember install:addon ember-moment` | ||
* ember-cli < 0.2.3 `ember install:addon ember-moment` | ||
* ember-cli >= 0.2.3 `ember install ember-moment` | ||
@@ -20,3 +21,3 @@ ```hbs | ||
{{moment date outputFormat inputFormat}} | ||
{{ago date inputFormat}}} | ||
{{ago date inputFormat}} | ||
{{duration number units}} | ||
@@ -37,2 +38,15 @@ ``` | ||
## Include Moment Timezone | ||
You can optionally include the Moment Timezone package in your `Brocfile.js` like so: | ||
```js | ||
var app = new EmberApp({ | ||
'ember-moment': { | ||
// moment-timezone dataset to include. Either 'all', '2010-2020', or 'none'. | ||
'includeTimezone': 'all' | ||
} | ||
}); | ||
``` | ||
## Development | ||
@@ -39,0 +53,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34149
671
67