diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 561e02c734..c1a7655f48 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -945,7 +945,13 @@ const RocketChat = { if (API_Use_REST_For_DDP_Calls) { return this.post(`method.call/${ method }`, { message: EJSON.stringify({ method, params }) }); } - return this.methodCall(method, ...params); + const parsedParams = params.map((param) => { + if (param instanceof Date) { + return { $date: new Date(param).getTime() }; + } + return param; + }); + return this.methodCall(method, ...parsedParams); }, getUserRoles() {