{"action":"created","comment":{"url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/comments/71962856","id":71962856,"diff_hunk":"@@ -0,0 +1,45 @@\n+package org.sagebionetworks.warehouse.workers.utils;\n+\n+import java.util.Date;\n+\n+import org.joda.time.DateTime;\n+\n+public class DateTimeUtils {\n+\tpublic static final String DATE_FORMAT = \"%04d-%02d-%02d\";\n+\n+\t/**\n+\t * This method takes a java.util.Date and return the next month java.util.Date\n+\t * \n+\t * @param month\n+\t * @return\n+\t */\n+\tpublic static Date getNextMonth(Date month) {\n+\t\tDateTime time = new DateTime(month).plusMonths(1);\n+\t\treturn time.toDate();\n+\t}\n+\n+\t/**\n+\t * \n+\t * @param date\n+\t * @return a string representation of date in format yyyy-mm-dd\n+\t */\n+\tpublic static String toDateString(Date date) {\n+\t\tDateTime time = new DateTime(date);\n+\t\treturn String.format(DATE_FORMAT, time.getYear(), time.getMonthOfYear(), time.getDayOfMonth());\n+\t}\n+\n+\t/**\n+\t * \n+\t * @param time\n+\t * @return the first day of the previous month\n+\t */\n+\tpublic static DateTime getPrevMonthAndFloor(DateTime time) {","path":"src/main/java/org/sagebionetworks/warehouse/workers/utils/DateTimeUtils.java","position":36,"original_position":36,"commit_id":"4dec4f16740adfc5fa59609b4d816e6d7e74689f","original_commit_id":"4dec4f16740adfc5fa59609b4d816e6d7e74689f","user":{"login":"john-hill","id":1728181,"avatar_url":"https://avatars.githubusercontent.com/u/1728181?v=3","gravatar_id":"","url":"https://api.github.com/users/john-hill","html_url":"https://github.com/john-hill","followers_url":"https://api.github.com/users/john-hill/followers","following_url":"https://api.github.com/users/john-hill/following{/other_user}","gists_url":"https://api.github.com/users/john-hill/gists{/gist_id}","starred_url":"https://api.github.com/users/john-hill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-hill/subscriptions","organizations_url":"https://api.github.com/users/john-hill/orgs","repos_url":"https://api.github.com/users/john-hill/repos","events_url":"https://api.github.com/users/john-hill/events{/privacy}","received_events_url":"https://api.github.com/users/john-hill/received_events","type":"User","site_admin":false},"body":"getFirstDayOfPrevoiusMonth","created_at":"2016-07-23T00:37:22Z","updated_at":"2016-07-23T00:37:22Z","html_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76#discussion_r71962856","pull_request_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/comments/71962856"},"html":{"href":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76#discussion_r71962856"},"pull_request":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76","id":78410832,"html_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76","diff_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76.diff","patch_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76.patch","issue_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/76","number":76,"state":"open","locked":false,"title":"WW-24","user":{"login":"kimyen","id":4404426,"avatar_url":"https://avatars.githubusercontent.com/u/4404426?v=3","gravatar_id":"","url":"https://api.github.com/users/kimyen","html_url":"https://github.com/kimyen","followers_url":"https://api.github.com/users/kimyen/followers","following_url":"https://api.github.com/users/kimyen/following{/other_user}","gists_url":"https://api.github.com/users/kimyen/gists{/gist_id}","starred_url":"https://api.github.com/users/kimyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimyen/subscriptions","organizations_url":"https://api.github.com/users/kimyen/orgs","repos_url":"https://api.github.com/users/kimyen/repos","events_url":"https://api.github.com/users/kimyen/events{/privacy}","received_events_url":"https://api.github.com/users/kimyen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-22T00:58:28Z","updated_at":"2016-07-23T00:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77621a2ba1191c8f7b612fe06e652bc9971c1fc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/76/comments","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/statuses/4dec4f16740adfc5fa59609b4d816e6d7e74689f","head":{"label":"kimyen:users","ref":"users","sha":"4dec4f16740adfc5fa59609b4d816e6d7e74689f","user":{"login":"kimyen","id":4404426,"avatar_url":"https://avatars.githubusercontent.com/u/4404426?v=3","gravatar_id":"","url":"https://api.github.com/users/kimyen","html_url":"https://github.com/kimyen","followers_url":"https://api.github.com/users/kimyen/followers","following_url":"https://api.github.com/users/kimyen/following{/other_user}","gists_url":"https://api.github.com/users/kimyen/gists{/gist_id}","starred_url":"https://api.github.com/users/kimyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimyen/subscriptions","organizations_url":"https://api.github.com/users/kimyen/orgs","repos_url":"https://api.github.com/users/kimyen/repos","events_url":"https://api.github.com/users/kimyen/events{/privacy}","received_events_url":"https://api.github.com/users/kimyen/received_events","type":"User","site_admin":false},"repo":{"id":35557942,"name":"Synapse-Warehouse-Workers","full_name":"kimyen/Synapse-Warehouse-Workers","owner":{"login":"kimyen","id":4404426,"avatar_url":"https://avatars.githubusercontent.com/u/4404426?v=3","gravatar_id":"","url":"https://api.github.com/users/kimyen","html_url":"https://github.com/kimyen","followers_url":"https://api.github.com/users/kimyen/followers","following_url":"https://api.github.com/users/kimyen/following{/other_user}","gists_url":"https://api.github.com/users/kimyen/gists{/gist_id}","starred_url":"https://api.github.com/users/kimyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimyen/subscriptions","organizations_url":"https://api.github.com/users/kimyen/orgs","repos_url":"https://api.github.com/users/kimyen/repos","events_url":"https://api.github.com/users/kimyen/events{/privacy}","received_events_url":"https://api.github.com/users/kimyen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kimyen/Synapse-Warehouse-Workers","description":"Workers that maintain analytical data related to Synapse.","fork":true,"url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers","forks_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/forks","keys_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/teams","hooks_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/hooks","issue_events_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/issues/events{/number}","events_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/events","assignees_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/assignees{/user}","branches_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/branches{/branch}","tags_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/tags","blobs_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/git/refs{/sha}","trees_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/statuses/{sha}","languages_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/languages","stargazers_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/stargazers","contributors_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/contributors","subscribers_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/subscribers","subscription_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/subscription","commits_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/commits{/sha}","git_commits_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/git/commits{/sha}","comments_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/comments{/number}","issue_comment_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/issues/comments{/number}","contents_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/contents/{+path}","compare_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/merges","archive_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/downloads","issues_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/issues{/number}","pulls_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/pulls{/number}","milestones_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/milestones{/number}","notifications_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/labels{/name}","releases_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/releases{/id}","deployments_url":"https://api.github.com/repos/kimyen/Synapse-Warehouse-Workers/deployments","created_at":"2015-05-13T15:40:57Z","updated_at":"2015-10-05T20:42:30Z","pushed_at":"2016-07-22T01:00:46Z","git_url":"git://github.com/kimyen/Synapse-Warehouse-Workers.git","ssh_url":"git@github.com:kimyen/Synapse-Warehouse-Workers.git","clone_url":"https://github.com/kimyen/Synapse-Warehouse-Workers.git","svn_url":"https://github.com/kimyen/Synapse-Warehouse-Workers","homepage":null,"size":832,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Sage-Bionetworks:develop","ref":"develop","sha":"9507b7c5845f09bf7b3203f4dc3e7760eb1e199d","user":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"repo":{"id":34883336,"name":"Synapse-Warehouse-Workers","full_name":"Sage-Bionetworks/Synapse-Warehouse-Workers","owner":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers","description":"Workers that maintain analytical data related to Synapse.","fork":false,"url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers","forks_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/forks","keys_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/teams","hooks_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/hooks","issue_events_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/events{/number}","events_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/events","assignees_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/assignees{/user}","branches_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/branches{/branch}","tags_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/tags","blobs_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/statuses/{sha}","languages_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/languages","stargazers_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/stargazers","contributors_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/contributors","subscribers_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/subscribers","subscription_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/subscription","commits_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/contents/{+path}","compare_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/merges","archive_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/downloads","issues_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues{/number}","pulls_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls{/number}","milestones_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/milestones{/number}","notifications_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/labels{/name}","releases_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/releases{/id}","deployments_url":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/deployments","created_at":"2015-05-01T00:24:49Z","updated_at":"2016-02-15T20:39:16Z","pushed_at":"2016-07-22T01:00:46Z","git_url":"git://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers.git","ssh_url":"git@github.com:Sage-Bionetworks/Synapse-Warehouse-Workers.git","clone_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers.git","svn_url":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers","homepage":null,"size":809,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76"},"html":{"href":"https://github.com/Sage-Bionetworks/Synapse-Warehouse-Workers/pull/76"},"issue":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/76"},"comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Sage-Bionetworks/Synapse-Warehouse-Workers/statuses/4dec4f16740adfc5fa59609b4d816e6d7e74689f"}}}}
{"actor":{"display_login":"john-hill"}}