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

How can I use moment-timezone with 10 year data range with Typescript types #1089

Open
garethdn opened this issue Jan 16, 2024 · 1 comment
Labels

Comments

@garethdn
Copy link

If I import moment timezone with

import * as moment from 'moment-timezone';

I get all the required typings but all the data is preloaded. If I require only the 10 year range and I import like so

import moment from "moment-timezone/builds/moment-timezone-with-data-10-year-range"

I get only the data I want but no typings. Likewise if I import only the library with no data, I get no typings

import moment from 'moment-timezone/moment-timezone

@gilmoreorless
Copy link
Member

You're right — we currently only have types defined for moment-timezone and moment-timezone/moment-timezone-utils, but not any of the other import paths. I'll take a look at adding some extra definition files.

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

2 participants