{"action":"created","issue":{"url":"https://api.github.com/repos/opentrials/opentrials/issues/586","repository_url":"https://api.github.com/repos/opentrials/opentrials","labels_url":"https://api.github.com/repos/opentrials/opentrials/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/opentrials/opentrials/issues/586/comments","events_url":"https://api.github.com/repos/opentrials/opentrials/issues/586/events","html_url":"https://github.com/opentrials/opentrials/issues/586","id":193200132,"number":586,"title":"Date fields are altered at indexing","user":{"login":"georgiana-b","id":8862002,"avatar_url":"https://avatars.githubusercontent.com/u/8862002?v=3","gravatar_id":"","url":"https://api.github.com/users/georgiana-b","html_url":"https://github.com/georgiana-b","followers_url":"https://api.github.com/users/georgiana-b/followers","following_url":"https://api.github.com/users/georgiana-b/following{/other_user}","gists_url":"https://api.github.com/users/georgiana-b/gists{/gist_id}","starred_url":"https://api.github.com/users/georgiana-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgiana-b/subscriptions","organizations_url":"https://api.github.com/users/georgiana-b/orgs","repos_url":"https://api.github.com/users/georgiana-b/repos","events_url":"https://api.github.com/users/georgiana-b/events{/privacy}","received_events_url":"https://api.github.com/users/georgiana-b/received_events","type":"User","site_admin":false},"labels":[{"id":406873212,"url":"https://api.github.com/repos/opentrials/opentrials/labels/3.%20In%20Development","name":"3. In Development","color":"e6e6e6","default":false},{"id":352258562,"url":"https://api.github.com/repos/opentrials/opentrials/labels/API","name":"API","color":"1D2021","default":false},{"id":315016078,"url":"https://api.github.com/repos/opentrials/opentrials/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-02T19:39:26Z","updated_at":"2016-12-12T15:50:53Z","closed_at":"2016-12-12T15:50:53Z","body":"Date fields are altered by ElasticSearch mapping which offsets them by one day less by converting them to UTC.\r\nFor example, the '2015-07-07' date of [FDAApproval from seeds](https://github.com/opentrials/api/blob/master/seeds/trials.js#L202) is indexed as:\r\n\r\n```json\r\n{\r\n    \"fda_approval\":{\r\n        \"id\":\"NDA021738-000\",\r\n        \"supplement_number\":0,\r\n        \"type\":\"Approval\",\r\n        \"action_date\":\"2015-07-06T21:00:00.000Z\",\r\n        \"fda_application\":{\r\n            \"id\":\"NDA021738\",\r\n            \"drug_name\":\"KETOCONAZOLE\",\r\n            \"active_ingredients\":\"EXTINA\",\r\n            \"url\":\"http:\\/\\/localhost:10010\\/v1\\/fda_applications\\/NDA021738\",\r\n            \"type\":\"NDA\"\r\n        }\r\n    },\r\n    \"url\":\"http:\\/\\/localhost:10010\\/v1\\/documents\\/1d12e160-9c37-11e6-8e62-e4b3181a2c8c\",\r\n    \"source_id\":\"fda\"\r\n}\r\n```\r\nNotice how `action_date` is converted to `2015-07-06`. Same goes for trial `registration_date` and all other date fields. "},"comment":{"url":"https://api.github.com/repos/opentrials/opentrials/issues/comments/266466241","html_url":"https://github.com/opentrials/opentrials/issues/586#issuecomment-266466241","issue_url":"https://api.github.com/repos/opentrials/opentrials/issues/586","id":266466241,"user":{"login":"georgiana-b","id":8862002,"avatar_url":"https://avatars.githubusercontent.com/u/8862002?v=3","gravatar_id":"","url":"https://api.github.com/users/georgiana-b","html_url":"https://github.com/georgiana-b","followers_url":"https://api.github.com/users/georgiana-b/followers","following_url":"https://api.github.com/users/georgiana-b/following{/other_user}","gists_url":"https://api.github.com/users/georgiana-b/gists{/gist_id}","starred_url":"https://api.github.com/users/georgiana-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgiana-b/subscriptions","organizations_url":"https://api.github.com/users/georgiana-b/orgs","repos_url":"https://api.github.com/users/georgiana-b/repos","events_url":"https://api.github.com/users/georgiana-b/events{/privacy}","received_events_url":"https://api.github.com/users/georgiana-b/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T15:50:53Z","updated_at":"2016-12-12T15:50:53Z","body":"Closed via opentrials/api#127"}}
{"actor":{"display_login":"georgiana-b"}}