{"action":"opened","number":380,"pull_request":{"url":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380","id":36580407,"html_url":"https://github.com/briannesbitt/Carbon/pull/380","diff_url":"https://github.com/briannesbitt/Carbon/pull/380.diff","patch_url":"https://github.com/briannesbitt/Carbon/pull/380.patch","issue_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/380","number":380,"state":"open","locked":false,"title":"Dynamic first/last day of week and weekend days","user":{"login":"dani3l","id":1437502,"avatar_url":"https://avatars.githubusercontent.com/u/1437502?v=3","gravatar_id":"","url":"https://api.github.com/users/dani3l","html_url":"https://github.com/dani3l","followers_url":"https://api.github.com/users/dani3l/followers","following_url":"https://api.github.com/users/dani3l/following{/other_user}","gists_url":"https://api.github.com/users/dani3l/gists{/gist_id}","starred_url":"https://api.github.com/users/dani3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dani3l/subscriptions","organizations_url":"https://api.github.com/users/dani3l/orgs","repos_url":"https://api.github.com/users/dani3l/repos","events_url":"https://api.github.com/users/dani3l/events{/privacy}","received_events_url":"https://api.github.com/users/dani3l/received_events","type":"User","site_admin":false},"body":"In Israel, week starts at Sunday and ends at Saturday, weekend days are Friday and Saturday\r\nand many other countries has their own weekends and weird calendars.. so I think it might help others\r\n\r\nAdded:\r\nprotected static $weekStartsAt integer (use Carbon::DAYCONST)\r\nprotected static $weekEndsAt integer (use Carbon::DAYCONST)\r\nprotected static $weekendDays array (array of Carbon::DAYCONST)\r\npublic static function getWeekStartsAt()\r\npublic static function setWeekStartsAt($day)\r\npublic static function getWeekEndsAt()\r\npublic static function setWeekEndsAt($day)\r\npublic static function getWeekendDays()\r\npublic static function setWeekendDays($days)\r\n\r\nUpdated:\r\nisWeekday() - to use !$this->isWeekend()\r\nisWeekend() - to check if current day is in static::$weekendDays\r\nstartOfWeek() - to use static::$weekStartsAt\r\nendOfWeek() - to use static::$weekEndsAt","created_at":"2015-05-31T10:52:41Z","updated_at":"2015-05-31T10:52:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380/commits","review_comments_url":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380/comments","review_comment_url":"https://api.github.com/repos/briannesbitt/Carbon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/380/comments","statuses_url":"https://api.github.com/repos/briannesbitt/Carbon/statuses/b6fc6896ab776996b2b1e7ad3c534bd35257b7e3","head":{"label":"dani3l:dani3l-patch-better-weeks","ref":"dani3l-patch-better-weeks","sha":"b6fc6896ab776996b2b1e7ad3c534bd35257b7e3","user":{"login":"dani3l","id":1437502,"avatar_url":"https://avatars.githubusercontent.com/u/1437502?v=3","gravatar_id":"","url":"https://api.github.com/users/dani3l","html_url":"https://github.com/dani3l","followers_url":"https://api.github.com/users/dani3l/followers","following_url":"https://api.github.com/users/dani3l/following{/other_user}","gists_url":"https://api.github.com/users/dani3l/gists{/gist_id}","starred_url":"https://api.github.com/users/dani3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dani3l/subscriptions","organizations_url":"https://api.github.com/users/dani3l/orgs","repos_url":"https://api.github.com/users/dani3l/repos","events_url":"https://api.github.com/users/dani3l/events{/privacy}","received_events_url":"https://api.github.com/users/dani3l/received_events","type":"User","site_admin":false},"repo":{"id":36598882,"name":"Carbon","full_name":"dani3l/Carbon","owner":{"login":"dani3l","id":1437502,"avatar_url":"https://avatars.githubusercontent.com/u/1437502?v=3","gravatar_id":"","url":"https://api.github.com/users/dani3l","html_url":"https://github.com/dani3l","followers_url":"https://api.github.com/users/dani3l/followers","following_url":"https://api.github.com/users/dani3l/following{/other_user}","gists_url":"https://api.github.com/users/dani3l/gists{/gist_id}","starred_url":"https://api.github.com/users/dani3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dani3l/subscriptions","organizations_url":"https://api.github.com/users/dani3l/orgs","repos_url":"https://api.github.com/users/dani3l/repos","events_url":"https://api.github.com/users/dani3l/events{/privacy}","received_events_url":"https://api.github.com/users/dani3l/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dani3l/Carbon","description":"A simple PHP API extension for DateTime.","fork":true,"url":"https://api.github.com/repos/dani3l/Carbon","forks_url":"https://api.github.com/repos/dani3l/Carbon/forks","keys_url":"https://api.github.com/repos/dani3l/Carbon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dani3l/Carbon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dani3l/Carbon/teams","hooks_url":"https://api.github.com/repos/dani3l/Carbon/hooks","issue_events_url":"https://api.github.com/repos/dani3l/Carbon/issues/events{/number}","events_url":"https://api.github.com/repos/dani3l/Carbon/events","assignees_url":"https://api.github.com/repos/dani3l/Carbon/assignees{/user}","branches_url":"https://api.github.com/repos/dani3l/Carbon/branches{/branch}","tags_url":"https://api.github.com/repos/dani3l/Carbon/tags","blobs_url":"https://api.github.com/repos/dani3l/Carbon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dani3l/Carbon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dani3l/Carbon/git/refs{/sha}","trees_url":"https://api.github.com/repos/dani3l/Carbon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dani3l/Carbon/statuses/{sha}","languages_url":"https://api.github.com/repos/dani3l/Carbon/languages","stargazers_url":"https://api.github.com/repos/dani3l/Carbon/stargazers","contributors_url":"https://api.github.com/repos/dani3l/Carbon/contributors","subscribers_url":"https://api.github.com/repos/dani3l/Carbon/subscribers","subscription_url":"https://api.github.com/repos/dani3l/Carbon/subscription","commits_url":"https://api.github.com/repos/dani3l/Carbon/commits{/sha}","git_commits_url":"https://api.github.com/repos/dani3l/Carbon/git/commits{/sha}","comments_url":"https://api.github.com/repos/dani3l/Carbon/comments{/number}","issue_comment_url":"https://api.github.com/repos/dani3l/Carbon/issues/comments{/number}","contents_url":"https://api.github.com/repos/dani3l/Carbon/contents/{+path}","compare_url":"https://api.github.com/repos/dani3l/Carbon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dani3l/Carbon/merges","archive_url":"https://api.github.com/repos/dani3l/Carbon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dani3l/Carbon/downloads","issues_url":"https://api.github.com/repos/dani3l/Carbon/issues{/number}","pulls_url":"https://api.github.com/repos/dani3l/Carbon/pulls{/number}","milestones_url":"https://api.github.com/repos/dani3l/Carbon/milestones{/number}","notifications_url":"https://api.github.com/repos/dani3l/Carbon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dani3l/Carbon/labels{/name}","releases_url":"https://api.github.com/repos/dani3l/Carbon/releases{/id}","created_at":"2015-05-31T10:49:40Z","updated_at":"2015-05-31T10:49:40Z","pushed_at":"2015-05-31T10:51:45Z","git_url":"git://github.com/dani3l/Carbon.git","ssh_url":"git@github.com:dani3l/Carbon.git","clone_url":"https://github.com/dani3l/Carbon.git","svn_url":"https://github.com/dani3l/Carbon","homepage":"http://carbon.nesbot.com/","size":3077,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"briannesbitt:master","ref":"master","sha":"68868e0b02d2d803d0052a59d4e5003cccf87320","user":{"login":"briannesbitt","id":170745,"avatar_url":"https://avatars.githubusercontent.com/u/170745?v=3","gravatar_id":"","url":"https://api.github.com/users/briannesbitt","html_url":"https://github.com/briannesbitt","followers_url":"https://api.github.com/users/briannesbitt/followers","following_url":"https://api.github.com/users/briannesbitt/following{/other_user}","gists_url":"https://api.github.com/users/briannesbitt/gists{/gist_id}","starred_url":"https://api.github.com/users/briannesbitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briannesbitt/subscriptions","organizations_url":"https://api.github.com/users/briannesbitt/orgs","repos_url":"https://api.github.com/users/briannesbitt/repos","events_url":"https://api.github.com/users/briannesbitt/events{/privacy}","received_events_url":"https://api.github.com/users/briannesbitt/received_events","type":"User","site_admin":false},"repo":{"id":5724990,"name":"Carbon","full_name":"briannesbitt/Carbon","owner":{"login":"briannesbitt","id":170745,"avatar_url":"https://avatars.githubusercontent.com/u/170745?v=3","gravatar_id":"","url":"https://api.github.com/users/briannesbitt","html_url":"https://github.com/briannesbitt","followers_url":"https://api.github.com/users/briannesbitt/followers","following_url":"https://api.github.com/users/briannesbitt/following{/other_user}","gists_url":"https://api.github.com/users/briannesbitt/gists{/gist_id}","starred_url":"https://api.github.com/users/briannesbitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briannesbitt/subscriptions","organizations_url":"https://api.github.com/users/briannesbitt/orgs","repos_url":"https://api.github.com/users/briannesbitt/repos","events_url":"https://api.github.com/users/briannesbitt/events{/privacy}","received_events_url":"https://api.github.com/users/briannesbitt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briannesbitt/Carbon","description":"A simple PHP API extension for DateTime.","fork":false,"url":"https://api.github.com/repos/briannesbitt/Carbon","forks_url":"https://api.github.com/repos/briannesbitt/Carbon/forks","keys_url":"https://api.github.com/repos/briannesbitt/Carbon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briannesbitt/Carbon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briannesbitt/Carbon/teams","hooks_url":"https://api.github.com/repos/briannesbitt/Carbon/hooks","issue_events_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/events{/number}","events_url":"https://api.github.com/repos/briannesbitt/Carbon/events","assignees_url":"https://api.github.com/repos/briannesbitt/Carbon/assignees{/user}","branches_url":"https://api.github.com/repos/briannesbitt/Carbon/branches{/branch}","tags_url":"https://api.github.com/repos/briannesbitt/Carbon/tags","blobs_url":"https://api.github.com/repos/briannesbitt/Carbon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briannesbitt/Carbon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briannesbitt/Carbon/git/refs{/sha}","trees_url":"https://api.github.com/repos/briannesbitt/Carbon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briannesbitt/Carbon/statuses/{sha}","languages_url":"https://api.github.com/repos/briannesbitt/Carbon/languages","stargazers_url":"https://api.github.com/repos/briannesbitt/Carbon/stargazers","contributors_url":"https://api.github.com/repos/briannesbitt/Carbon/contributors","subscribers_url":"https://api.github.com/repos/briannesbitt/Carbon/subscribers","subscription_url":"https://api.github.com/repos/briannesbitt/Carbon/subscription","commits_url":"https://api.github.com/repos/briannesbitt/Carbon/commits{/sha}","git_commits_url":"https://api.github.com/repos/briannesbitt/Carbon/git/commits{/sha}","comments_url":"https://api.github.com/repos/briannesbitt/Carbon/comments{/number}","issue_comment_url":"https://api.github.com/repos/briannesbitt/Carbon/issues/comments{/number}","contents_url":"https://api.github.com/repos/briannesbitt/Carbon/contents/{+path}","compare_url":"https://api.github.com/repos/briannesbitt/Carbon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briannesbitt/Carbon/merges","archive_url":"https://api.github.com/repos/briannesbitt/Carbon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briannesbitt/Carbon/downloads","issues_url":"https://api.github.com/repos/briannesbitt/Carbon/issues{/number}","pulls_url":"https://api.github.com/repos/briannesbitt/Carbon/pulls{/number}","milestones_url":"https://api.github.com/repos/briannesbitt/Carbon/milestones{/number}","notifications_url":"https://api.github.com/repos/briannesbitt/Carbon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briannesbitt/Carbon/labels{/name}","releases_url":"https://api.github.com/repos/briannesbitt/Carbon/releases{/id}","created_at":"2012-09-08T02:56:20Z","updated_at":"2015-05-31T01:07:56Z","pushed_at":"2015-05-31T10:52:09Z","git_url":"git://github.com/briannesbitt/Carbon.git","ssh_url":"git@github.com:briannesbitt/Carbon.git","clone_url":"https://github.com/briannesbitt/Carbon.git","svn_url":"https://github.com/briannesbitt/Carbon","homepage":"http://carbon.nesbot.com/","size":3077,"stargazers_count":2974,"watchers_count":2974,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":328,"mirror_url":null,"open_issues_count":43,"forks":328,"open_issues":43,"watchers":2974,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380"},"html":{"href":"https://github.com/briannesbitt/Carbon/pull/380"},"issue":{"href":"https://api.github.com/repos/briannesbitt/Carbon/issues/380"},"comments":{"href":"https://api.github.com/repos/briannesbitt/Carbon/issues/380/comments"},"review_comments":{"href":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380/comments"},"review_comment":{"href":"https://api.github.com/repos/briannesbitt/Carbon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/briannesbitt/Carbon/pulls/380/commits"},"statuses":{"href":"https://api.github.com/repos/briannesbitt/Carbon/statuses/b6fc6896ab776996b2b1e7ad3c534bd35257b7e3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":97,"deletions":8,"changed_files":1}}