From bee85a995ee72ab5adad833ca617d5a4a021166d Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Fri, 15 Jul 2016 23:16:27 -0400 Subject: [PATCH] Makes sure dates are compatible with Parse.com CloudCode #2214 --- spec/ParseAPI.spec.js | 2 +- src/Routers/FunctionsRouter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/ParseAPI.spec.js b/spec/ParseAPI.spec.js index 532623c05e..32a5f9877d 100644 --- a/spec/ParseAPI.spec.js +++ b/spec/ParseAPI.spec.js @@ -1046,7 +1046,7 @@ describe('miscellaneous', function() { response.success('yay'); }); - Parse.Cloud.run('func', {date: date}) + Parse.Cloud.run('dateFunc', {date: date}) .then(() => { done() }, e => { diff --git a/src/Routers/FunctionsRouter.js b/src/Routers/FunctionsRouter.js index b29aa99a8c..c1219d2568 100644 --- a/src/Routers/FunctionsRouter.js +++ b/src/Routers/FunctionsRouter.js @@ -13,7 +13,7 @@ function parseObject(obj) { return parseObject(item); }); } else if (obj && obj.__type == 'Date') { - return new Date(obj.iso); + return Object.assign(new Date(obj.iso), obj); } else if (obj && obj.__type == 'File') { return Parse.File.fromJSON(obj); } else if (obj && typeof obj === 'object') {