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

Moment Timezone has no data for... #193

Closed
chocochik92 opened this issue Mar 17, 2015 · 4 comments
Closed

Moment Timezone has no data for... #193

chocochik92 opened this issue Mar 17, 2015 · 4 comments

Comments

@chocochik92
Copy link

i've just started using moment-timezone 0.3.1 and did npm install and bower install. (i'm also using moment 2.9.0)

I'm trying to convert a date to a different timezone using moment.tz(date, timezone).format();
This error comes up Moment Timezone has no data for America/New_York. See http://momentjs.com/timezone/docs/#/data-loading/.

I've gone to that page and I get how you can add timezones. But I already have that timezone info in the data folder with both packed and unpacked json files. So why does this message show up? Do I have to manually add what timezones I want to use?

@chocochik92 chocochik92 changed the title Moment TImezone has no data for... Moment Timezone has no data for... Mar 17, 2015
@mattjohnsonpint
Copy link
Contributor

Works for me. Here's a screenshot on a fresh empty directory.

image

Yes, I'm on Windows, but that shouldn't matter. There are no OS-specific dependencies at runtime.

@mattjohnsonpint
Copy link
Contributor

Closing for now. If you can demonstrate it failing, please do and I'll reopen. Thanks.

@pixelchutes
Copy link

FWIW, I recently went through an upgrade from moment 2.4.0 > 2.10.2 + moment-timezone 0.3.1 (where timezone + tzdata are now combined.) I was able to reproduce this error, but only because I was loading moment-timezone, then loading moment-timezone-with-data immediately after. This is obviously not the correct approach.

Removing the first instance, leaving only the new combined version resolved this for me. Just mentioning it here incase someone else runs into this issue, make sure you're not unnecessarily redeclaring moment-timezone.

@mattjohnsonpint
Copy link
Contributor

Yes, I've heard of this a few times, such as here. We should probably guard against this somehow.

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

3 participants