-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Packager] Requiring momentjs locale fails #1629
Comments
just do then you can do something like this
|
That’s what I did. I can use moment and I’ve been using it with react-native, but I cannot change the moment
|
@alvaromb - just a quick thought from browsing the moment docs, what about:
|
Also, see this: moment/moment#2007 (comment) If it doesn't fix the problem, let me know and I'll reopen |
Super @brentvatne!! I haven't found that option in the docs. Many thanks. |
@brentvatne loading the locale directly i.e
Is there other way to solve it besides:
|
It works. Thanks. |
This is a bit old now but I'd like to show you how I've done it. I'm using react-native-i18n.
`import I18n from 'react-native-i18n'; export default { |
Same question here: I would like to load dynamically depending on user/device but I dan't want to write a long serie of 'case'. @ranyefet solution still seem to be the only valid one... @JBerendes seems equivalent but even more work... |
I also have this issue: for some reason it doesn't seem to be possible to do a dynamic include based on the locale. |
It seems that this is and old and unsolved issue. The only solution is import all locale explicitly. Check out facebook/react-native#1629
I'm trying to use a different locale for Moment.js, and I keep receiving the same error. This is the code:
And I'm receiving this error in the Chrome Dev Tools console:
It doesn't seems a Moment.js error though.
The text was updated successfully, but these errors were encountered: