Skip to content

Commit

Permalink
Makes sure dates are compatible with Parse.com CloudCode #2214
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Jul 16, 2016
1 parent 58328c6 commit bee85a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/ParseAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion src/Routers/FunctionsRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit bee85a9

Please sign in to comment.