From b6e7a5758a000fc93ffa2963a874c1fea63fa351 Mon Sep 17 00:00:00 2001 From: Satbir Date: Tue, 17 Dec 2019 18:07:12 +0530 Subject: [PATCH] Adding moment to js execution --- app/client/src/jsExecution/JSExecutionManagerSingleton.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/client/src/jsExecution/JSExecutionManagerSingleton.ts b/app/client/src/jsExecution/JSExecutionManagerSingleton.ts index 796bb9ae03..f98bc07ef2 100644 --- a/app/client/src/jsExecution/JSExecutionManagerSingleton.ts +++ b/app/client/src/jsExecution/JSExecutionManagerSingleton.ts @@ -1,4 +1,5 @@ import RealmExecutor from "./RealmExecutor"; +import moment from "moment-timezone"; export type JSExecutorGlobal = Record; export interface JSExecutor { @@ -41,6 +42,7 @@ class JSExecutionManager { this.currentExecutor = realmExecutor; this.registerLibrary("_", window._); + this.registerLibrary("moment", moment); } evaluateSync(jsSrc: string, data: JSExecutorGlobal) { return this.currentExecutor.execute(jsSrc, data);