adopted-ember-addons / ember-moment

MIT License
399 stars 122 forks source link

Returning and overriding the timeZone within tests #236

Open aaronfischer opened 7 years ago

aaronfischer commented 7 years ago

I can't determine if this is something that is automatic and I'm just experiencing a setup/config issue or if my assumption on this is off.

Does ember-moment have a service that automatically returns you the user's/current timeZone? I'm attempting this.get('moment.timeZone') but it returns null. (However, I can set it with this.get('moment').setTimeZone('America/Los_Angeles');)

We've recently changed some of the date/time formatting within our application and I'm working on rendering the UTC date/time. This portion I haven't had any problems with. The issue I'm running into is overriding this during our testing to force a consistent timeZone. I assumed that the best way to do this was to setup a config/environment timeZone variable and when applicable set the timeZone global on the moment service which can then be distilled down to instances of {{moment-format ...}}. Is this an appropriate strategy?

Thanks!