liquid.js icon indicating copy to clipboard operation
liquid.js copied to clipboard

Only use strftime if in browser environment, for use in Node.js

Open tomblanchard opened this issue 10 years ago • 2 comments

I am using liquid.js in a Node.js environment and am getting the document is not defined error when compiling templates due to strftime relying on the DOM, document doesn't exist in Node.js, my changes make is so strftime is used only when window is present (i.e. in a browser environment).

tomblanchard avatar Nov 16 '15 17:11 tomblanchard

Does this still build correctly and pass all the tests?

mattmccray avatar Nov 18 '15 03:11 mattmccray

@mattmccray Sure does.

tomblanchard avatar Nov 18 '15 10:11 tomblanchard