adopted-ember-addons / adopted-ember-addons/ember-moment

Returning and overriding the timeZone within tests

Ouverte
#236 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
398
Forks
120
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.