plow-js icon indicating copy to clipboard operation
plow-js copied to clipboard

Dates are transformed to ISO strings

Open ipanasenko opened this issue 9 years ago • 2 comments

There's a line const object = JSON.parse(JSON.stringify(subject)); in src/migrations/atoms/set/index.js, it results in Date objects being transformed into ISO strings (e.g. '2016-07-11T18:31:28.608Z').

Why is this line needed?

ipanasenko avatar Jul 11 '16 18:07 ipanasenko

Correct me if i'm wrong, but it looks like they are attempting to make object a deep copy of subject, otherwise it would just be a reference to subject.

YurkaninRyan avatar Jan 19 '17 20:01 YurkaninRyan

Look like it, but deep copying can be done a little more clever than simple stringify-parse, I think

ipanasenko avatar Jan 19 '17 21:01 ipanasenko