mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Date serialisation mismatch from Meteor default. #78

Open pavanputhra opened 8 years ago

pavanputhra commented 8 years ago

Suppose there is a meteor method "foo" which take following argument

var args = {
    date: new Date()
}

If we call this method from Meteor client date object is serialised properly.

Meteor.call("foo",args);

//in server args.date will be date object

If we call this method using asteroid date object is represented as string.

asteorid.call('foo',args)

//in server args.date will be string in following format '2015-10-12T06:30:00.000Z'

This mismatch will lead develper to write specilized code to fix this issue as follows.

//in server. work around

if(!(args.date instanceof Date)){
        args.date = new Date(args.date);
}
rafaelcorreiapoli commented 8 years ago

Any updates on this? I'm having the same issue

aadamsx commented 7 years ago

+1