{"action":"opened","number":191,"pull_request":{"url":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191","id":65623250,"html_url":"https://github.com/malcommac/SwiftDate/pull/191","diff_url":"https://github.com/malcommac/SwiftDate/pull/191.diff","patch_url":"https://github.com/malcommac/SwiftDate/pull/191.patch","issue_url":"https://api.github.com/repos/malcommac/SwiftDate/issues/191","number":191,"state":"open","locked":false,"title":"Add Region.defaultRegionProvider and defaultRegion()","user":{"login":"ypresto","id":400558,"avatar_url":"https://avatars.githubusercontent.com/u/400558?v=3","gravatar_id":"","url":"https://api.github.com/users/ypresto","html_url":"https://github.com/ypresto","followers_url":"https://api.github.com/users/ypresto/followers","following_url":"https://api.github.com/users/ypresto/following{/other_user}","gists_url":"https://api.github.com/users/ypresto/gists{/gist_id}","starred_url":"https://api.github.com/users/ypresto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ypresto/subscriptions","organizations_url":"https://api.github.com/users/ypresto/orgs","repos_url":"https://api.github.com/users/ypresto/repos","events_url":"https://api.github.com/users/ypresto/events{/privacy}","received_events_url":"https://api.github.com/users/ypresto/received_events","type":"User","site_admin":false},"body":"I found that recently defaultRegion is removed, after writing this patch.....\r\nBut I think it is necessary for following reasons:\r\n\r\n- To cache Region object to get rid of overhead of NSCalendar initialization.\r\n- Currently tests depending on default locale fail in non-English locale machine.\r\n\r\nIt could be implemented as built-in caching mechanism, but provider enables to controll cache storage and lifecycle by library user.\r\n\r\n### Caching example\r\n\r\n```swift\r\nRegion.defaultRegionProvider = {\r\n    if let cachedRegion = NSThread.currentThread().threadDictionary[kCacheKey] {\r\n        return cachedRegion\r\n    }\r\n    let region = Region(...)\r\n    NSThread.currentThread().threadDictionary[kCacheKey] = region\r\n    return region\r\n}","created_at":"2016-04-07T12:43:17Z","updated_at":"2016-04-07T12:43:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191/commits","review_comments_url":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191/comments","review_comment_url":"https://api.github.com/repos/malcommac/SwiftDate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/malcommac/SwiftDate/issues/191/comments","statuses_url":"https://api.github.com/repos/malcommac/SwiftDate/statuses/6e2e0452adab771b94f47cde9a0690ca937e8f36","head":{"label":"ypresto:default-region","ref":"default-region","sha":"6e2e0452adab771b94f47cde9a0690ca937e8f36","user":{"login":"ypresto","id":400558,"avatar_url":"https://avatars.githubusercontent.com/u/400558?v=3","gravatar_id":"","url":"https://api.github.com/users/ypresto","html_url":"https://github.com/ypresto","followers_url":"https://api.github.com/users/ypresto/followers","following_url":"https://api.github.com/users/ypresto/following{/other_user}","gists_url":"https://api.github.com/users/ypresto/gists{/gist_id}","starred_url":"https://api.github.com/users/ypresto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ypresto/subscriptions","organizations_url":"https://api.github.com/users/ypresto/orgs","repos_url":"https://api.github.com/users/ypresto/repos","events_url":"https://api.github.com/users/ypresto/events{/privacy}","received_events_url":"https://api.github.com/users/ypresto/received_events","type":"User","site_admin":false},"repo":{"id":55691613,"name":"SwiftDate","full_name":"ypresto/SwiftDate","owner":{"login":"ypresto","id":400558,"avatar_url":"https://avatars.githubusercontent.com/u/400558?v=3","gravatar_id":"","url":"https://api.github.com/users/ypresto","html_url":"https://github.com/ypresto","followers_url":"https://api.github.com/users/ypresto/followers","following_url":"https://api.github.com/users/ypresto/following{/other_user}","gists_url":"https://api.github.com/users/ypresto/gists{/gist_id}","starred_url":"https://api.github.com/users/ypresto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ypresto/subscriptions","organizations_url":"https://api.github.com/users/ypresto/orgs","repos_url":"https://api.github.com/users/ypresto/repos","events_url":"https://api.github.com/users/ypresto/events{/privacy}","received_events_url":"https://api.github.com/users/ypresto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ypresto/SwiftDate","description":"Powerful NSDate & Time Zones Management, made in Swift 2","fork":true,"url":"https://api.github.com/repos/ypresto/SwiftDate","forks_url":"https://api.github.com/repos/ypresto/SwiftDate/forks","keys_url":"https://api.github.com/repos/ypresto/SwiftDate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ypresto/SwiftDate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ypresto/SwiftDate/teams","hooks_url":"https://api.github.com/repos/ypresto/SwiftDate/hooks","issue_events_url":"https://api.github.com/repos/ypresto/SwiftDate/issues/events{/number}","events_url":"https://api.github.com/repos/ypresto/SwiftDate/events","assignees_url":"https://api.github.com/repos/ypresto/SwiftDate/assignees{/user}","branches_url":"https://api.github.com/repos/ypresto/SwiftDate/branches{/branch}","tags_url":"https://api.github.com/repos/ypresto/SwiftDate/tags","blobs_url":"https://api.github.com/repos/ypresto/SwiftDate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ypresto/SwiftDate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ypresto/SwiftDate/git/refs{/sha}","trees_url":"https://api.github.com/repos/ypresto/SwiftDate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ypresto/SwiftDate/statuses/{sha}","languages_url":"https://api.github.com/repos/ypresto/SwiftDate/languages","stargazers_url":"https://api.github.com/repos/ypresto/SwiftDate/stargazers","contributors_url":"https://api.github.com/repos/ypresto/SwiftDate/contributors","subscribers_url":"https://api.github.com/repos/ypresto/SwiftDate/subscribers","subscription_url":"https://api.github.com/repos/ypresto/SwiftDate/subscription","commits_url":"https://api.github.com/repos/ypresto/SwiftDate/commits{/sha}","git_commits_url":"https://api.github.com/repos/ypresto/SwiftDate/git/commits{/sha}","comments_url":"https://api.github.com/repos/ypresto/SwiftDate/comments{/number}","issue_comment_url":"https://api.github.com/repos/ypresto/SwiftDate/issues/comments{/number}","contents_url":"https://api.github.com/repos/ypresto/SwiftDate/contents/{+path}","compare_url":"https://api.github.com/repos/ypresto/SwiftDate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ypresto/SwiftDate/merges","archive_url":"https://api.github.com/repos/ypresto/SwiftDate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ypresto/SwiftDate/downloads","issues_url":"https://api.github.com/repos/ypresto/SwiftDate/issues{/number}","pulls_url":"https://api.github.com/repos/ypresto/SwiftDate/pulls{/number}","milestones_url":"https://api.github.com/repos/ypresto/SwiftDate/milestones{/number}","notifications_url":"https://api.github.com/repos/ypresto/SwiftDate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ypresto/SwiftDate/labels{/name}","releases_url":"https://api.github.com/repos/ypresto/SwiftDate/releases{/id}","deployments_url":"https://api.github.com/repos/ypresto/SwiftDate/deployments","created_at":"2016-04-07T12:09:51Z","updated_at":"2016-04-07T12:09:52Z","pushed_at":"2016-04-07T12:26:38Z","git_url":"git://github.com/ypresto/SwiftDate.git","ssh_url":"git@github.com:ypresto/SwiftDate.git","clone_url":"https://github.com/ypresto/SwiftDate.git","svn_url":"https://github.com/ypresto/SwiftDate","homepage":"","size":4712,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"malcommac:develop","ref":"develop","sha":"596634c5d5b545af583c30f967491107a35f88ca","user":{"login":"malcommac","id":235645,"avatar_url":"https://avatars.githubusercontent.com/u/235645?v=3","gravatar_id":"","url":"https://api.github.com/users/malcommac","html_url":"https://github.com/malcommac","followers_url":"https://api.github.com/users/malcommac/followers","following_url":"https://api.github.com/users/malcommac/following{/other_user}","gists_url":"https://api.github.com/users/malcommac/gists{/gist_id}","starred_url":"https://api.github.com/users/malcommac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malcommac/subscriptions","organizations_url":"https://api.github.com/users/malcommac/orgs","repos_url":"https://api.github.com/users/malcommac/repos","events_url":"https://api.github.com/users/malcommac/events{/privacy}","received_events_url":"https://api.github.com/users/malcommac/received_events","type":"User","site_admin":false},"repo":{"id":35143711,"name":"SwiftDate","full_name":"malcommac/SwiftDate","owner":{"login":"malcommac","id":235645,"avatar_url":"https://avatars.githubusercontent.com/u/235645?v=3","gravatar_id":"","url":"https://api.github.com/users/malcommac","html_url":"https://github.com/malcommac","followers_url":"https://api.github.com/users/malcommac/followers","following_url":"https://api.github.com/users/malcommac/following{/other_user}","gists_url":"https://api.github.com/users/malcommac/gists{/gist_id}","starred_url":"https://api.github.com/users/malcommac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malcommac/subscriptions","organizations_url":"https://api.github.com/users/malcommac/orgs","repos_url":"https://api.github.com/users/malcommac/repos","events_url":"https://api.github.com/users/malcommac/events{/privacy}","received_events_url":"https://api.github.com/users/malcommac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/malcommac/SwiftDate","description":"Powerful NSDate & Time Zones Management, made in Swift 2","fork":false,"url":"https://api.github.com/repos/malcommac/SwiftDate","forks_url":"https://api.github.com/repos/malcommac/SwiftDate/forks","keys_url":"https://api.github.com/repos/malcommac/SwiftDate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malcommac/SwiftDate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malcommac/SwiftDate/teams","hooks_url":"https://api.github.com/repos/malcommac/SwiftDate/hooks","issue_events_url":"https://api.github.com/repos/malcommac/SwiftDate/issues/events{/number}","events_url":"https://api.github.com/repos/malcommac/SwiftDate/events","assignees_url":"https://api.github.com/repos/malcommac/SwiftDate/assignees{/user}","branches_url":"https://api.github.com/repos/malcommac/SwiftDate/branches{/branch}","tags_url":"https://api.github.com/repos/malcommac/SwiftDate/tags","blobs_url":"https://api.github.com/repos/malcommac/SwiftDate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malcommac/SwiftDate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malcommac/SwiftDate/git/refs{/sha}","trees_url":"https://api.github.com/repos/malcommac/SwiftDate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malcommac/SwiftDate/statuses/{sha}","languages_url":"https://api.github.com/repos/malcommac/SwiftDate/languages","stargazers_url":"https://api.github.com/repos/malcommac/SwiftDate/stargazers","contributors_url":"https://api.github.com/repos/malcommac/SwiftDate/contributors","subscribers_url":"https://api.github.com/repos/malcommac/SwiftDate/subscribers","subscription_url":"https://api.github.com/repos/malcommac/SwiftDate/subscription","commits_url":"https://api.github.com/repos/malcommac/SwiftDate/commits{/sha}","git_commits_url":"https://api.github.com/repos/malcommac/SwiftDate/git/commits{/sha}","comments_url":"https://api.github.com/repos/malcommac/SwiftDate/comments{/number}","issue_comment_url":"https://api.github.com/repos/malcommac/SwiftDate/issues/comments{/number}","contents_url":"https://api.github.com/repos/malcommac/SwiftDate/contents/{+path}","compare_url":"https://api.github.com/repos/malcommac/SwiftDate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malcommac/SwiftDate/merges","archive_url":"https://api.github.com/repos/malcommac/SwiftDate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malcommac/SwiftDate/downloads","issues_url":"https://api.github.com/repos/malcommac/SwiftDate/issues{/number}","pulls_url":"https://api.github.com/repos/malcommac/SwiftDate/pulls{/number}","milestones_url":"https://api.github.com/repos/malcommac/SwiftDate/milestones{/number}","notifications_url":"https://api.github.com/repos/malcommac/SwiftDate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malcommac/SwiftDate/labels{/name}","releases_url":"https://api.github.com/repos/malcommac/SwiftDate/releases{/id}","deployments_url":"https://api.github.com/repos/malcommac/SwiftDate/deployments","created_at":"2015-05-06T06:46:24Z","updated_at":"2016-04-07T09:52:49Z","pushed_at":"2016-04-07T12:43:17Z","git_url":"git://github.com/malcommac/SwiftDate.git","ssh_url":"git@github.com:malcommac/SwiftDate.git","clone_url":"https://github.com/malcommac/SwiftDate.git","svn_url":"https://github.com/malcommac/SwiftDate","homepage":"","size":4843,"stargazers_count":1296,"watchers_count":1296,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"open_issues_count":11,"forks":120,"open_issues":11,"watchers":1296,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191"},"html":{"href":"https://github.com/malcommac/SwiftDate/pull/191"},"issue":{"href":"https://api.github.com/repos/malcommac/SwiftDate/issues/191"},"comments":{"href":"https://api.github.com/repos/malcommac/SwiftDate/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/malcommac/SwiftDate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/malcommac/SwiftDate/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/malcommac/SwiftDate/statuses/6e2e0452adab771b94f47cde9a0690ca937e8f36"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":90,"deletions":14,"changed_files":10}}