Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone not accesible after upgrading to version 9 #370

Open
jasalguero opened this issue Dec 28, 2021 · 2 comments
Open

Timezone not accesible after upgrading to version 9 #370

jasalguero opened this issue Dec 28, 2021 · 2 comments

Comments

@jasalguero
Copy link

jasalguero commented Dec 28, 2021

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

...
│ ├── [email protected] deduped
│ └── [email protected] 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

@jasalguero
Copy link
Author

I tried also with a clean new Ember app (v4), just installing ember-moment and trying to access the timezone throws the exception

@sreeram-cv
Copy link

sreeram-cv commented Oct 10, 2023

I am also facing the same issue. @jasalguero did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants