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

Does not work with latest moment-timezone #17

Closed
jason-codaio opened this issue Nov 21, 2017 · 4 comments
Closed

Does not work with latest moment-timezone #17

jason-codaio opened this issue Nov 21, 2017 · 4 comments

Comments

@jason-codaio
Copy link

jason-codaio commented Nov 21, 2017

The moment-weekday-calc methods no longer properly attach to moment-timezone when upgrading to 0.5.14

You can still access them if you import moment directly but doing so causes all sorts of timezone conversion issues.

@andruhon
Copy link
Owner

Hi! Could you please provide an example of failing code (with dependencies list)?

@jason-codaio
Copy link
Author

Sorry about the delay :)

I dug more into this and it looks like I was thrown off by a yarn bug yarnpkg/yarn#3967 which was creating two instances of moment. This caused moment-weekday-calc to attach to the wrong instance of moment.

Which brings me to a different point, while modifying globals in javascript seems fairly par for the course it does not seem like a great practice. It would be awesome if moment-weekday-calc instead exposed an api directly.

Thanks!

@andruhon
Copy link
Owner

@jason-krypton as far as I remember it exports WeekDayCalc, I'll have a look, thanks

@macrozone
Copy link

similar problem on react-native where i need to import import moment from 'moment/min/moment-with-locales'

is there a static method which can be applied to moment to attach this functionallity?

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