We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version: 0.5.33 TypeScript: 3.7.4
Note: many issues are resolved if you just upgrade to the latest version
Using moment-timezone-utils with typescript will load the data from the base moment-timezone import.
moment-timezone-utils
moment-timezone
import moment from 'moment'; import 'moment-timezone/moment-timezone'; import 'moment-timezone/moment-timezone-utils'; console.log(moment.tz.dataVersion) // => '2021a'
I'd expect the dataVersion to be undefined with no data loaded.
dataVersion
Leaving out the moment-timezone-utils gives the expected empty string.
import moment from 'moment'; import 'moment-timezone/moment-timezone'; console.log(moment.tz.dataVersion) // => ''
The text was updated successfully, but these errors were encountered:
The issue is that we load ./ for node, which is ./index.js which loads the data, by design.
./
./index.js
Here's a patch that fixes it:
diff --git a/moment-timezone-utils.js b/moment-timezone-utils.js index 73d088a..45b2991 100644 --- a/moment-timezone-utils.js +++ b/moment-timezone-utils.js @@ -9,7 +9,7 @@ /*global define*/ if (typeof module === 'object' && module.exports) { - module.exports = factory(require('./')); // Node + module.exports = factory(require('./moment-timezone')); // Node } else if (typeof define === 'function' && define.amd) { define(['moment'], factory); // AMD } else {
I have to wrap my head around all the exported items to make sure we don't break somebody's workflow...
Sorry, something went wrong.
No branches or pull requests
Moment-timezone version which you use:
Version: 0.5.33
TypeScript: 3.7.4
Note: many issues are resolved if you just upgrade to the latest version
Issue description:
Using
moment-timezone-utils
with typescript will load the data from the basemoment-timezone
import.I'd expect the
dataVersion
to be undefined with no data loaded.Leaving out the
moment-timezone-utils
gives the expected empty string.The text was updated successfully, but these errors were encountered: