Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerializableObject#copy does a pointer copy for SerializableType Date. #3

Open
bradyellison opened this issue Oct 9, 2014 · 0 comments

Comments

@bradyellison
Copy link

SerializeableType#serialize calls moment(rawValue).toDate(). If rawValue is already a data, under certain versions of moment.js (tested with 1.7.0), moment does not create a new Date object.

Any modifications done to the date are reflected in the original date value as well. Example on JSFiddle.

The simplest fix is to simply wrap the call in:

new Date(<date>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant