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

Timezone not accesible after upgrading to version 9

Abierto
#370 2 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
398
Forks
120
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.