adopted-ember-addons / adopted-ember-addons/ember-moment
Timezone not accesible after upgrading to version 9
- 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
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100