{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/86","labels_url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/86/comments","events_url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/86/events","html_url":"https://github.com/Starcounter-Jack/JSON-Patch/issues/86","id":117204779,"number":86,"title":"Compare fails to see difference in Date","user":{"login":"object88","id":11822106,"avatar_url":"https://avatars.githubusercontent.com/u/11822106?v=3","gravatar_id":"","url":"https://api.github.com/users/object88","html_url":"https://github.com/object88","followers_url":"https://api.github.com/users/object88/followers","following_url":"https://api.github.com/users/object88/following{/other_user}","gists_url":"https://api.github.com/users/object88/gists{/gist_id}","starred_url":"https://api.github.com/users/object88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/object88/subscriptions","organizations_url":"https://api.github.com/users/object88/orgs","repos_url":"https://api.github.com/users/object88/repos","events_url":"https://api.github.com/users/object88/events{/privacy}","received_events_url":"https://api.github.com/users/object88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-16T19:56:14Z","updated_at":"2015-11-16T20:14:55Z","closed_at":null,"body":"The `compare` function of this library does not report a difference between two Date objects.\r\n\r\n```javascript\r\nvar jsonpatch = require('fast-json-patch');\r\n\r\nvar o1 = { d: new Date(1900, 12, 31, 12, 59, 59) };\r\nvar o2 = { d: new Date(1999, 12, 31, 12, 59, 59) };\r\n\r\nvar diff = jsonpatch.compare(o1, o2);\r\nconsole.log(diff);\r\n```\r\n\r\nThe result of this script is an empty array.  I would expect a 'replace' to be reported."},"comment":{"url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/comments/157156796","html_url":"https://github.com/Starcounter-Jack/JSON-Patch/issues/86#issuecomment-157156796","issue_url":"https://api.github.com/repos/Starcounter-Jack/JSON-Patch/issues/86","id":157156796,"user":{"login":"warpech","id":566463,"avatar_url":"https://avatars.githubusercontent.com/u/566463?v=3","gravatar_id":"","url":"https://api.github.com/users/warpech","html_url":"https://github.com/warpech","followers_url":"https://api.github.com/users/warpech/followers","following_url":"https://api.github.com/users/warpech/following{/other_user}","gists_url":"https://api.github.com/users/warpech/gists{/gist_id}","starred_url":"https://api.github.com/users/warpech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warpech/subscriptions","organizations_url":"https://api.github.com/users/warpech/orgs","repos_url":"https://api.github.com/users/warpech/repos","events_url":"https://api.github.com/users/warpech/events{/privacy}","received_events_url":"https://api.github.com/users/warpech/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T20:14:55Z","updated_at":"2015-11-16T20:14:55Z","body":"`jsonpatch.compare` compares two **JSON** documents. `Date` is not a supported JSON property. \r\n\r\nRelated: https://github.com/Starcounter-Jack/JSON-Patch/issues/4\r\n\r\nThere is a slight chance we will support this in future by reporting the difference as string. `JSON.stringify` converts `Date` to a string (e.g. \"2015-11-16T20:12:55.209Z\") and we could use that as a reference. \r\n\r\nThe biggest focus of this library is performance though, so we will only do it if it does not impact the performance of typical JSON."}}