-
Notifications
You must be signed in to change notification settings - Fork 835
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
Issues trying to run moment-with-locales.js and moment-timezone together #143
Comments
I am having this issue also. Any workaround so that we can use both of these? I think the problem is with moment-timezone. It is looking for another version of moment in the environment and cannot find it (or something like that). |
You have to create a shim for the moment.js when you define them in require.js. In both moment.js and moment with locales you have the moment object define. Timezone is a standalone with no basic moment included. But you can't just include the moment or moment with locales. You have to shim the moment define in the require.js definition and export the Moment object from the momentjs class. Kevin ----- Original Message ----- From: "kaizenmantra" notifications@github.com I am having this issue also. Any workaround so that we can use both of these? I think the problem is with moment-timezone. It is looking for another version of moment in the environment and cannot find it (or something like that). — |
This needs a documented example. |
If this is undocumented, happy to take a pull. |
This needs a workable solution. I'm not a frontend developer and have NFI how to get this working with babel and brunch, so crowdsourcing would be waiting for Godot. script tags for locale and with tzdata work fine, but we absolutely cannot use that because it doesn't work with the asset compiler. |
@steakknife at the end of the day these are both UMD modules. The JS ecosystem currently has approximately 700 billion ways to use UMD modules. As a team, we aren't able to do anything but crowd source - I can tell you how to use it with grunt, and with webpack, but that's it because that's all I personally use. |
We've found a solution. Thanks a brunch!
…On Tue, May 16, 2017 at 11:13 AM Maggie Pint ***@***.***> wrote:
@steakknife <https://github.com/steakknife> at the end of the day these
are both UMD modules. The JS ecosystem currently has approximately 700
billion ways to use UMD modules. As a team, we aren't able to do anything
but crowd source - I can tell you how to use it with grunt, and with
webpack, but that's it because that's all I personally use.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANsMGdqc4uA0TIEluy5KCGfuNXj-Am7ks5r6ec2gaJpZM4Czadq>
.
|
@steakknife . can you please help to share the solution. we are facing same issue. |
we are having an issue that is probably like this. I need to use timezones and localized formatting in the same .js file. Right now I need to do like this:
and then use tzmoment and moment as standalone packages: tzmoment to parse timezones and moment to format dates to localized output. Is it possible to "merge" imports somehow, so that I would need to import only moment-timezone and use localized formatting? |
+1 |
Given the age of this issue, and the high rate of change of dependency managers in the JS ecosystem, this is near impossible to diagnose. If this problem is still happening, it's best to create a new issue with more details. |
For a framework I'm working on I tried packaging moment-with-locales.js and moment-timezone.js together. All the locale stuff works fine but when i try to use the tz function to set the timezone I get and error that tz does not exist.
This also occurs when I just load the scripts separately.
If I run straight up moment.js and timezones tz works.
Is there any reason why I can't run the locales with timezone? I have timezone 0.2.2 and moment 2.8.3
The text was updated successfully, but these errors were encountered: