adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

Update documentation #227

Closed herzzanu closed 7 years ago

herzzanu commented 7 years ago

this.get('moment').setTimeZone('America/Los_Angeles') should be this.get('moment').set('timezone', 'America/Los_Angeles')

and this.get('moment').setLocale('es') should be this.get('moment').set('locale', 'es')

At least that's how it works for me.

jasonmit commented 7 years ago

Yes you can go around the moment service but it is the public API for a reason.

Moment does not trigger events on locale change, and I have no intentions of monkey patching moment to observe locale changes. This is required so people go through these setter methods in order to trigger things like ember-helper recomputes when the locale changes at runtime.

It also enables a API for subscribing to locale change events within your Ember application.