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

Returning and overriding the timeZone within tests

Đang mở
#236 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
398
Fork
120
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.