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

Fix bug with Date Apply #10

Conversation

LeComptoirDesPharmacies
Copy link

According to #9 , there is a bug when applying JSON patch with fields as "Date".
These should be custom managed like Arrays.

I did not use function to test Date from external library (as lodash for example) in order to minimize library size.
Some tests were added to test these specific cases.

@pierreinglebert
Copy link
Owner

Thanks for the PR,
As I just wrote in the issue #9 Date representation is not specified in JSON so it's kinda an expected behavior. I'm looking for the possibility to apply toJSON() (will work for date).

@LeComptoirDesPharmacies
Copy link
Author

Oh okay, I understand your solution of using toJSON for these objects. As Date use ISO 8601 representation it is a good idea. What could be strange is that Date object is converted to String on apply / generate but it may be fine for some usages. ;)

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

Successfully merging this pull request may close these issues.

3 participants