Skip to content

Expose moment in Demandware environment #1034

Description

@intel352

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:

// Function to make Moment available
var moment;
function getMoment() {
    return moment;
}

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions