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

Timezone not accesible after upgrading to version 9

オープン
#370 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
398
フォーク
120
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi, I'm upgrading some application's ember versions and after upgrading to the lastest ember-moment (9.0.1) I get error while trying to access the timezone. It works fine reverting back to ember-moment 8x

```
ember -v

ember-cli: 3.28.5
node: 14.16.0
os: darwin x64`

```

npm list
```
...
│ ├── moment@2.29.1 deduped
│ └── moment-timezone@0.5.34 ded
...
```

```
//config.environment

module.exports = function() {
return {
moment: {
// Options:
// 'all' - all years, all timezones
// 'subset' - 2012-2022, all timezones
// 'none' - no data, just timezone API
includeTimezone: 'subset'
}
}
};
```

Trying to use the .tz in the code throws an exception

```
import moment from 'moment';

export const convertDateToUTC = (
date,
timezone,
format = 'MM/DD/YYYY HH:mm'
) => {
return moment(date, format).tz(timezone, true).toJSON();
};
```

Throws: `TypeError: (0 , _moment.default)(...).tz is not a function`

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Reproduce the failure with ember-moment 9.0.1 using the provided Ember, Node, moment, and moment-timezone versions. Read config.environment and the convertDateToUTC entry point, then compare the same call with ember-moment 8.x. Done means moment(...).tz(timezone, true) works with includeTimezone set to subset.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。