adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

moment-from-now does not return unit as per locale #239

Closed ashrafhasson closed 7 years ago

ashrafhasson commented 7 years ago

Thanks for the awesome addon.

I've been struggling to get this to return the unit, years in this case, in the locale I've set on the helper:

{{moment-from-now "Sat Jul 01 1978 21:18:08 GMT-0400 (EDT)" locale='ar' hideSuffix=true}}

the figure returned looks good but the unit doesn't get changed to what it's supposed to be:

39 years

I've already set includeLocales: true in config.environment, is there something I missed? Appreciate any hint, thanks.

jasonmit commented 7 years ago

There isn't an issue and I validated that with a test: https://github.com/stefanpenner/ember-moment/commit/49e7fa4ec1c914733006aff7df4c8625725a628b

The only thing I can guess is you have another addon which is also requiring momentjs and that is taking presedence over the one ember-moment (ember-cli-moment-shim) brings in.

yarn why moment to see which other addons might be requiring moment as a dependency (not a devdep)

ashrafhasson commented 7 years ago

@jasonmit nice one, I didn't have yarn (maybe I should!) but I trimmed my package.json removing "ember-welcome-page": "^2.0.2" and that did the trick, thanks!