{"action":"opened","number":160,"pull_request":{"url":"https://api.github.com/repos/bear/parsedatetime/pulls/160","id":68801225,"html_url":"https://github.com/bear/parsedatetime/pull/160","diff_url":"https://github.com/bear/parsedatetime/pull/160.diff","patch_url":"https://github.com/bear/parsedatetime/pull/160.patch","issue_url":"https://api.github.com/repos/bear/parsedatetime/issues/160","number":160,"state":"open","locked":false,"title":"fix (by deletion?) \"some duration before noon/dinner/etc\"","user":{"login":"jonklein","id":194568,"avatar_url":"https://avatars.githubusercontent.com/u/194568?v=3","gravatar_id":"","url":"https://api.github.com/users/jonklein","html_url":"https://github.com/jonklein","followers_url":"https://api.github.com/users/jonklein/followers","following_url":"https://api.github.com/users/jonklein/following{/other_user}","gists_url":"https://api.github.com/users/jonklein/gists{/gist_id}","starred_url":"https://api.github.com/users/jonklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonklein/subscriptions","organizations_url":"https://api.github.com/users/jonklein/orgs","repos_url":"https://api.github.com/users/jonklein/repos","events_url":"https://api.github.com/users/jonklein/events{/privacy}","received_events_url":"https://api.github.com/users/jonklein/received_events","type":"User","site_admin":false},"body":"Fixes cases of relative times with CRE_TIME patterns like \"noon\", \"lunch\", etc, for example: `5 minutes before noon tomorrow`, `1 hour after dinner`.  These evaluations were getting offset by an entire day forward/backwards based on the word before or after.\r\n\r\n```\r\n# before\r\n>>> pdt.Calendar().nlp(\"One hour after dinner\") # today is 5/3\r\n((datetime.datetime(2016, 5, 4, 20, 0), 2, 0, 21, 'One hour after dinner'),)\r\n\r\n# after this change:\r\n>>> pdt.Calendar().nlp(\"One hour after dinner\")\r\n((datetime.datetime(2016, 5, 3, 20, 0), 2, 0, 21, 'One hour after dinner'),)\r\n```\r\n\r\nThis might be dangerous territory, but I cannot figure out the intention of the code which was causing this issue - I see that it has been copy/pasted/ported through a number of refactors and suspect that it has been made obsolete and is now only causing problems.  This PR fixes the scenarios stated above, and I cannot come up with any other modifier/cre_time pairing that would be parsed correctly with the old code.\r\n\r\nThe test cases for these scenarios were already written, but have been commented out for years!  This PR re-enables those tests and introduces no new failures. \r\n\r\n","created_at":"2016-05-04T01:45:18Z","updated_at":"2016-05-04T01:45:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bear/parsedatetime/pulls/160/commits","review_comments_url":"https://api.github.com/repos/bear/parsedatetime/pulls/160/comments","review_comment_url":"https://api.github.com/repos/bear/parsedatetime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bear/parsedatetime/issues/160/comments","statuses_url":"https://api.github.com/repos/bear/parsedatetime/statuses/00e5dc83c61cc4c2b2fd8d712a524f03d7695fc9","head":{"label":"jonklein:fix/before_noon","ref":"fix/before_noon","sha":"00e5dc83c61cc4c2b2fd8d712a524f03d7695fc9","user":{"login":"jonklein","id":194568,"avatar_url":"https://avatars.githubusercontent.com/u/194568?v=3","gravatar_id":"","url":"https://api.github.com/users/jonklein","html_url":"https://github.com/jonklein","followers_url":"https://api.github.com/users/jonklein/followers","following_url":"https://api.github.com/users/jonklein/following{/other_user}","gists_url":"https://api.github.com/users/jonklein/gists{/gist_id}","starred_url":"https://api.github.com/users/jonklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonklein/subscriptions","organizations_url":"https://api.github.com/users/jonklein/orgs","repos_url":"https://api.github.com/users/jonklein/repos","events_url":"https://api.github.com/users/jonklein/events{/privacy}","received_events_url":"https://api.github.com/users/jonklein/received_events","type":"User","site_admin":false},"repo":{"id":51860669,"name":"parsedatetime","full_name":"jonklein/parsedatetime","owner":{"login":"jonklein","id":194568,"avatar_url":"https://avatars.githubusercontent.com/u/194568?v=3","gravatar_id":"","url":"https://api.github.com/users/jonklein","html_url":"https://github.com/jonklein","followers_url":"https://api.github.com/users/jonklein/followers","following_url":"https://api.github.com/users/jonklein/following{/other_user}","gists_url":"https://api.github.com/users/jonklein/gists{/gist_id}","starred_url":"https://api.github.com/users/jonklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonklein/subscriptions","organizations_url":"https://api.github.com/users/jonklein/orgs","repos_url":"https://api.github.com/users/jonklein/repos","events_url":"https://api.github.com/users/jonklein/events{/privacy}","received_events_url":"https://api.github.com/users/jonklein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonklein/parsedatetime","description":"","fork":true,"url":"https://api.github.com/repos/jonklein/parsedatetime","forks_url":"https://api.github.com/repos/jonklein/parsedatetime/forks","keys_url":"https://api.github.com/repos/jonklein/parsedatetime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonklein/parsedatetime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonklein/parsedatetime/teams","hooks_url":"https://api.github.com/repos/jonklein/parsedatetime/hooks","issue_events_url":"https://api.github.com/repos/jonklein/parsedatetime/issues/events{/number}","events_url":"https://api.github.com/repos/jonklein/parsedatetime/events","assignees_url":"https://api.github.com/repos/jonklein/parsedatetime/assignees{/user}","branches_url":"https://api.github.com/repos/jonklein/parsedatetime/branches{/branch}","tags_url":"https://api.github.com/repos/jonklein/parsedatetime/tags","blobs_url":"https://api.github.com/repos/jonklein/parsedatetime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonklein/parsedatetime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonklein/parsedatetime/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonklein/parsedatetime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonklein/parsedatetime/statuses/{sha}","languages_url":"https://api.github.com/repos/jonklein/parsedatetime/languages","stargazers_url":"https://api.github.com/repos/jonklein/parsedatetime/stargazers","contributors_url":"https://api.github.com/repos/jonklein/parsedatetime/contributors","subscribers_url":"https://api.github.com/repos/jonklein/parsedatetime/subscribers","subscription_url":"https://api.github.com/repos/jonklein/parsedatetime/subscription","commits_url":"https://api.github.com/repos/jonklein/parsedatetime/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonklein/parsedatetime/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonklein/parsedatetime/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonklein/parsedatetime/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonklein/parsedatetime/contents/{+path}","compare_url":"https://api.github.com/repos/jonklein/parsedatetime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonklein/parsedatetime/merges","archive_url":"https://api.github.com/repos/jonklein/parsedatetime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonklein/parsedatetime/downloads","issues_url":"https://api.github.com/repos/jonklein/parsedatetime/issues{/number}","pulls_url":"https://api.github.com/repos/jonklein/parsedatetime/pulls{/number}","milestones_url":"https://api.github.com/repos/jonklein/parsedatetime/milestones{/number}","notifications_url":"https://api.github.com/repos/jonklein/parsedatetime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonklein/parsedatetime/labels{/name}","releases_url":"https://api.github.com/repos/jonklein/parsedatetime/releases{/id}","deployments_url":"https://api.github.com/repos/jonklein/parsedatetime/deployments","created_at":"2016-02-16T19:03:46Z","updated_at":"2016-02-16T19:03:47Z","pushed_at":"2016-05-04T01:23:46Z","git_url":"git://github.com/jonklein/parsedatetime.git","ssh_url":"git@github.com:jonklein/parsedatetime.git","clone_url":"https://github.com/jonklein/parsedatetime.git","svn_url":"https://github.com/jonklein/parsedatetime","homepage":null,"size":636,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"bear:master","ref":"master","sha":"ea5dcc16c8ba622b265dffcef1b647b842d7b754","user":{"login":"bear","id":1267,"avatar_url":"https://avatars.githubusercontent.com/u/1267?v=3","gravatar_id":"","url":"https://api.github.com/users/bear","html_url":"https://github.com/bear","followers_url":"https://api.github.com/users/bear/followers","following_url":"https://api.github.com/users/bear/following{/other_user}","gists_url":"https://api.github.com/users/bear/gists{/gist_id}","starred_url":"https://api.github.com/users/bear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bear/subscriptions","organizations_url":"https://api.github.com/users/bear/orgs","repos_url":"https://api.github.com/users/bear/repos","events_url":"https://api.github.com/users/bear/events{/privacy}","received_events_url":"https://api.github.com/users/bear/received_events","type":"User","site_admin":false},"repo":{"id":5775977,"name":"parsedatetime","full_name":"bear/parsedatetime","owner":{"login":"bear","id":1267,"avatar_url":"https://avatars.githubusercontent.com/u/1267?v=3","gravatar_id":"","url":"https://api.github.com/users/bear","html_url":"https://github.com/bear","followers_url":"https://api.github.com/users/bear/followers","following_url":"https://api.github.com/users/bear/following{/other_user}","gists_url":"https://api.github.com/users/bear/gists{/gist_id}","starred_url":"https://api.github.com/users/bear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bear/subscriptions","organizations_url":"https://api.github.com/users/bear/orgs","repos_url":"https://api.github.com/users/bear/repos","events_url":"https://api.github.com/users/bear/events{/privacy}","received_events_url":"https://api.github.com/users/bear/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bear/parsedatetime","description":"","fork":false,"url":"https://api.github.com/repos/bear/parsedatetime","forks_url":"https://api.github.com/repos/bear/parsedatetime/forks","keys_url":"https://api.github.com/repos/bear/parsedatetime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bear/parsedatetime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bear/parsedatetime/teams","hooks_url":"https://api.github.com/repos/bear/parsedatetime/hooks","issue_events_url":"https://api.github.com/repos/bear/parsedatetime/issues/events{/number}","events_url":"https://api.github.com/repos/bear/parsedatetime/events","assignees_url":"https://api.github.com/repos/bear/parsedatetime/assignees{/user}","branches_url":"https://api.github.com/repos/bear/parsedatetime/branches{/branch}","tags_url":"https://api.github.com/repos/bear/parsedatetime/tags","blobs_url":"https://api.github.com/repos/bear/parsedatetime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bear/parsedatetime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bear/parsedatetime/git/refs{/sha}","trees_url":"https://api.github.com/repos/bear/parsedatetime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bear/parsedatetime/statuses/{sha}","languages_url":"https://api.github.com/repos/bear/parsedatetime/languages","stargazers_url":"https://api.github.com/repos/bear/parsedatetime/stargazers","contributors_url":"https://api.github.com/repos/bear/parsedatetime/contributors","subscribers_url":"https://api.github.com/repos/bear/parsedatetime/subscribers","subscription_url":"https://api.github.com/repos/bear/parsedatetime/subscription","commits_url":"https://api.github.com/repos/bear/parsedatetime/commits{/sha}","git_commits_url":"https://api.github.com/repos/bear/parsedatetime/git/commits{/sha}","comments_url":"https://api.github.com/repos/bear/parsedatetime/comments{/number}","issue_comment_url":"https://api.github.com/repos/bear/parsedatetime/issues/comments{/number}","contents_url":"https://api.github.com/repos/bear/parsedatetime/contents/{+path}","compare_url":"https://api.github.com/repos/bear/parsedatetime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bear/parsedatetime/merges","archive_url":"https://api.github.com/repos/bear/parsedatetime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bear/parsedatetime/downloads","issues_url":"https://api.github.com/repos/bear/parsedatetime/issues{/number}","pulls_url":"https://api.github.com/repos/bear/parsedatetime/pulls{/number}","milestones_url":"https://api.github.com/repos/bear/parsedatetime/milestones{/number}","notifications_url":"https://api.github.com/repos/bear/parsedatetime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bear/parsedatetime/labels{/name}","releases_url":"https://api.github.com/repos/bear/parsedatetime/releases{/id}","deployments_url":"https://api.github.com/repos/bear/parsedatetime/deployments","created_at":"2012-09-12T06:44:45Z","updated_at":"2016-05-02T09:04:00Z","pushed_at":"2016-03-20T22:36:24Z","git_url":"git://github.com/bear/parsedatetime.git","ssh_url":"git@github.com:bear/parsedatetime.git","clone_url":"https://github.com/bear/parsedatetime.git","svn_url":"https://github.com/bear/parsedatetime","homepage":null,"size":633,"stargazers_count":326,"watchers_count":326,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":23,"forks":60,"open_issues":23,"watchers":326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bear/parsedatetime/pulls/160"},"html":{"href":"https://github.com/bear/parsedatetime/pull/160"},"issue":{"href":"https://api.github.com/repos/bear/parsedatetime/issues/160"},"comments":{"href":"https://api.github.com/repos/bear/parsedatetime/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/bear/parsedatetime/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/bear/parsedatetime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bear/parsedatetime/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/bear/parsedatetime/statuses/00e5dc83c61cc4c2b2fd8d712a524f03d7695fc9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":16,"changed_files":2}}