{"action":"closed","issue":{"url":"https://api.github.com/repos/scottwrobinson/camo/issues/46","repository_url":"https://api.github.com/repos/scottwrobinson/camo","labels_url":"https://api.github.com/repos/scottwrobinson/camo/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/scottwrobinson/camo/issues/46/comments","events_url":"https://api.github.com/repos/scottwrobinson/camo/issues/46/events","html_url":"https://github.com/scottwrobinson/camo/issues/46","id":130151589,"number":46,"title":"Allow Date type fields to be populated with date string (beside number or Date instance)","user":{"login":"royaltm","id":615066,"avatar_url":"https://avatars.githubusercontent.com/u/615066?v=3","gravatar_id":"","url":"https://api.github.com/users/royaltm","html_url":"https://github.com/royaltm","followers_url":"https://api.github.com/users/royaltm/followers","following_url":"https://api.github.com/users/royaltm/following{/other_user}","gists_url":"https://api.github.com/users/royaltm/gists{/gist_id}","starred_url":"https://api.github.com/users/royaltm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/royaltm/subscriptions","organizations_url":"https://api.github.com/users/royaltm/orgs","repos_url":"https://api.github.com/users/royaltm/repos","events_url":"https://api.github.com/users/royaltm/events{/privacy}","received_events_url":"https://api.github.com/users/royaltm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scottwrobinson/camo/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-31T16:57:14Z","updated_at":"2016-02-24T16:58:27Z","closed_at":"2016-02-24T16:58:27Z","body":"It would be very nice if camo validator would accept field with declared type Data values as strings.\r\nCurrently we may use numbers or date instances but no date strings.\r\n\r\nI think simple Date.parse would suffice to interpret strings.\r\n\r\nWhy:\r\n\r\nI'm using camo (with my neat hack) in a browser (via my own REST client for camo) and after serializing/deserializing JSON objects, all Date fields become ISO date strings on the backend.\r\n\r\nThe workaround is to:\r\n`Date.prototype.toJSON = Date.prototype.getTime` in the browser.\r\n\r\nbut I would like to leave Date.prototype.toJSON untouched and allow the camo validators to convert those date strings to Date objects."}}