-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Expose moment in Demandware environment #1034
Comments
Huh. I've never heard of Demandware, but I guess I don't understand the issue exactly. Why can Moment.ds find moment, but other files can't? |
I've run into references to this particular platform before, I think. The issue is that, to Demandware, Though, I'm a little curious why Demandware can't tell that a variable assigned a function ( |
I linked to this issue from the docs: http://momentjs.com/docs/#/use-it/other/ |
docs? what docs? localhost? |
Sorry, edited |
sorry... on second reading, i sounded like an idiot :( This is the first time outside of a company of a friend of mine that I'm even hearing the name of demandware though :) |
I'm working on a site built using Demandware (hosted ecommerce platform). Demandware is built on Java, and has Rhino included for scripting. ES4th edition proposal is supported with JS 1.7, but there seem to be limitations/bugs in some of the native ES functionality. Scripts are given the extension .ds, variables are not exported (only functions).
To get Moment working within Demandware, I renamed the file to Moment.ds, and added the following to the top of the file:
Then in any script that includes Moment.ds, I have to add
var moment = getMoment();
.If you could add this information somewhere, or somehow use it to further expose Moment for closed environments such as Demandware, that would be excellent.
The text was updated successfully, but these errors were encountered: