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 include all data for specific timezone #303

Open
fran-worley opened this issue Apr 8, 2019 · 6 comments
Open

moment-timezone include all data for specific timezone #303

fran-worley opened this issue Apr 8, 2019 · 6 comments
Labels

Comments

@fran-worley
Copy link

Based on the options for including timezone data there doesn't appear to be a way to include all data for just one timezone. We only operate in the UK but hold data going back 20+ years so are currently having to import 'all'. It would reduce our build size if we could limit the import to just "Europe/London|Europe/Belfast".

Is there a way to do this?

@jasonmit
Copy link
Collaborator

There isn't an automatic way of doing this.

However, you can strip out the timezone data you need and manually register the data. Afterwards, be sure to set includeTimezone: "none".

Hopefully that help!

@fran-worley
Copy link
Author

Thanks Jason,

I actually tried this originally but ran into issues where moment.tz was undefined so fell back to importing all. It's possible that I was attempting to manually register in the wrong place but either way I figured some docs might be useful for everyone given that build size is quite a hot topic with ember at the moment...

@RobbieTheWagner
Copy link
Member

We're also looking for ways to reduce our build size, and moment-timezone is currently almost double the size of Ember itself in our bundle! Would love some suggestions on how to include less timezones and less locales for moment itself, etc.

@jasonmit
Copy link
Collaborator

@rwwagner90 Does this not cover your use case: https://github.com/jasonmit/ember-cli-moment-shim#cherry-pick-locales-optimal

@RobbieTheWagner
Copy link
Member

@jasonmit that looks like it should work for locales. We currently have includeTimezone: 'all' as well though, so I assume we have to manually load timezone data? We don't actually want all timezones, I don't think, but I am not 100% sure which ones we do want now.

@preethi-sathiyanarayanan

same here. a way to reduce the size due to timezone would be helpful

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

No branches or pull requests

4 participants