ember-moment
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -7,13 +7,15 @@ import moment from 'ember-moment/helpers/moment'; | ||
export var initialize = function(/* container, app */) { | ||
var helper; | ||
var registerHelper; | ||
if (Ember.HTMLBars) { | ||
helper = Ember.HTMLBars._registerHelper; | ||
registerHelper = function (helperName, fn) { | ||
Ember.HTMLBars._registerHelper(helperName, Ember.HTMLBars.makeBoundHelper(fn)); | ||
} | ||
} else { | ||
helper = Ember.Handlebars.helper; | ||
registerHelper = Ember.Handlebars.helper; | ||
}; | ||
helper('moment', moment); | ||
helper('ago', ago); | ||
helper('duration', duration); | ||
registerHelper('moment', moment); | ||
registerHelper('ago', ago); | ||
registerHelper('duration', duration); | ||
}; | ||
@@ -20,0 +22,0 @@ |
{ | ||
"name": "ember-moment", | ||
"dependencies": { | ||
"handlebars": "~1.3.0", | ||
"jquery": "^1.11.1", | ||
"ember": "1.8.1", | ||
"ember": "1.10.0", | ||
"ember-resolver": "~0.1.10", | ||
"loader.js": "stefanpenner/loader.js#1.0.1", | ||
"ember-cli-moment-shim": "jasonmit/ember-cli-moment-shim#0.0.2", | ||
"ember-cli-moment-shim": "jasonmit/ember-cli-moment-shim#0.0.3", | ||
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", | ||
@@ -11,0 +10,0 @@ "ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1", |
@@ -6,3 +6,7 @@ /* jshint node: true */ | ||
var app = new EmberAddon(); | ||
var app = new EmberAddon({ | ||
vendorFiles: { | ||
'handlebars.js': null | ||
} | ||
}); | ||
@@ -30,2 +34,4 @@ // Use `app.import` to add additional libraries to the generated | ||
app.import(app.bowerDirectory + '/ember/ember-template-compiler.js'); | ||
module.exports = app.toTree(); |
@@ -0,1 +1,5 @@ | ||
### 1.1.1 | ||
* [BUGFIX] HTMLBars should use `makeBoundHelper` | ||
### 1.1.0 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "ember-moment", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Moment.js template helpers for ember", | ||
@@ -25,2 +25,3 @@ "directories": { | ||
"ember-cli-dependency-checker": "0.0.7", | ||
"ember-cli-htmlbars": "^0.7.4", | ||
"ember-cli-ic-ajax": "0.1.1", | ||
@@ -27,0 +28,0 @@ "ember-cli-inject-live-reload": "^1.3.0", |
@@ -0,4 +1,7 @@ | ||
import Ember from 'ember'; | ||
import date from './date'; | ||
import moment from 'ember-moment/helpers/moment'; | ||
import callHelper from '../../helpers/call-helper'; | ||
import { initialize } from '../../../initializers/ember-moment'; | ||
import { runAppend, runDestroy } from '../../helpers/run-append'; | ||
@@ -25,1 +28,26 @@ module('MomentHelper'); | ||
}); | ||
test('change date input and change is reflected by bound helper', function() { | ||
initialize(); | ||
var context = Ember.Object.create({ | ||
date: date(0) | ||
}); | ||
var view = Ember.View.create({ | ||
template: Ember.HTMLBars.compile('{{moment date}}'), | ||
context: context | ||
}); | ||
runAppend(view); | ||
equal(view.$().text(), 'Wednesday, December 31, 1969 7:00 PM'); | ||
Ember.run(function () { | ||
context.set('date', date(60*60*24)); | ||
}); | ||
equal(view.$().text(), 'Wednesday, December 31, 1969 7:01 PM'); | ||
runDestroy(view); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33099
654
0
10
63