Closed mickeyjohn closed 3 years ago
@mickeyjohn - thanks for reporting this. This looks like a bug to me.
@harshithakp - can you pls have a look at this?
Note that this actually has nothing to do with Date
, it also occurs for an object:
var now = { a: 1 };
var gData = {
veh1: [
{ a: 1, b: 2, at: now },
{ a: 1, b: 2, at: now }
]
};
yJson.stringifyAsync(gData, (err, res) => {
if (err) return console.log(err);
console.log(res);
});
{"veh1":[{"a":1,"b":2,"at":{"a":1}},[object Object]]}
@HarshithaKP what is the current state of fixing this? Because without fixing this, this library won't be really usable in any project.
@mickeyjohn , @wanton7 - the reported issue is fixed, and 2.0.1
is published. Let me know if you are able to use it and verify at your end!
Hi, I would like to report a bug in the case of date objects within sub arrays. My test codes are:
Result:
{"veh1":[{"a":1,"b":2,"at":"2020-04-23T18:47:18.483Z"},[object Object]]}
The expected result:
{"veh1":[{"a":1,"b":2,"at":"2020-04-23T18:47:18.483Z"},{"a":1,"b":2,"at":"2020-04-23T18:47:18.483Z"}]}
which is the correct output when using JSON.stringify(gData);If I changed gData to:
var gData = { veh1: [{ a: 1, b: 2, at: new Date() }, { a: 1, b: 2, at: new Date() }] }
It would work as expected. Does any one know why?Thanks.