{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/comments/44870036","id":44870036,"diff_hunk":"@@ -1,20 +1,145 @@\n 'use strict';\n \n+var MS_IN_DAY = 1000 * 60 * 60 * 24;\n+var MS_IN_HOUR = 1000 * 60 * 60;\n+var MS_IN_MINUTE = 1000 * 60;\n+var weekToDays = {\n+    'ПН': '02',\n+    'ВТ': '03',\n+    'СР': '04',\n+    'ЧТ': '05',\n+    'ПТ': '06',\n+    'СБ': '07',\n+    'ВС': '08'\n+};\n+\n+var daysToWeek = {\n+    1: 'ВС',\n+    2: 'ПН',\n+    3: 'ВТ',\n+    4: 'СР',\n+    5: 'ЧТ',\n+    6: 'ПТ',\n+    7: 'СБ',\n+    8: 'ВС'\n+};\n+\n module.exports = function () {\n     return {\n-        // Здесь как-то хранится дата ;)\n-        date: null,\n-\n-        // А здесь часовой пояс\n         timezone: null,\n+        dateString: null,\n+        dateTime: null,\n+        dayOfWeek: null,\n+\n+        get date() {\n+            return this.dateTime;\n+        },\n+        set date(string) {\n+            this.dateString = string;\n+            var dataParts = string.split(' ');\n+            var dayOfWeek = weekToDays[dataParts[0]];\n+            this.dayOfWeek = dayOfWeek;\n+            var sign = '+';\n+            if (dataParts[1].indexOf('-') > -1) {\n+                sign = '-';\n+            }\n+            var time = dataParts[1].split(sign);\n+            var timezone = time[1];\n+            this.timezone = sign + timezone;\n+            if (timezone.length < 2) {\n+                timezone = '0' + timezone;\n+            }\n+            timezone = sign + timezone;","path":"moment.js","position":56,"original_position":56,"commit_id":"4d3990cf2ffbe3bc45c1f82f1091b4ab360d70be","original_commit_id":"4d3990cf2ffbe3bc45c1f82f1091b4ab360d70be","user":{"login":"mangin","id":7918881,"avatar_url":"https://avatars.githubusercontent.com/u/7918881?v=3","gravatar_id":"","url":"https://api.github.com/users/mangin","html_url":"https://github.com/mangin","followers_url":"https://api.github.com/users/mangin/followers","following_url":"https://api.github.com/users/mangin/following{/other_user}","gists_url":"https://api.github.com/users/mangin/gists{/gist_id}","starred_url":"https://api.github.com/users/mangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangin/subscriptions","organizations_url":"https://api.github.com/users/mangin/orgs","repos_url":"https://api.github.com/users/mangin/repos","events_url":"https://api.github.com/users/mangin/events{/privacy}","received_events_url":"https://api.github.com/users/mangin/received_events","type":"User","site_admin":false},"body":"давай-те в этой функции выделим функцию getTimezone(dateParts). Так как ваша функция уже очень сложная","created_at":"2015-11-15T10:42:22Z","updated_at":"2015-11-15T10:42:22Z","html_url":"https://github.com/urfu-2015/javascript-tasks-6/pull/26#discussion_r44870036","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/comments/44870036"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-6/pull/26#discussion_r44870036"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26","id":50183192,"html_url":"https://github.com/urfu-2015/javascript-tasks-6/pull/26","diff_url":"https://github.com/urfu-2015/javascript-tasks-6/pull/26.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-6/pull/26.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/26","number":26,"state":"open","locked":false,"title":"Аксёнова Наталья","user":{"login":"Dotokoto","id":8973726,"avatar_url":"https://avatars.githubusercontent.com/u/8973726?v=3","gravatar_id":"","url":"https://api.github.com/users/Dotokoto","html_url":"https://github.com/Dotokoto","followers_url":"https://api.github.com/users/Dotokoto/followers","following_url":"https://api.github.com/users/Dotokoto/following{/other_user}","gists_url":"https://api.github.com/users/Dotokoto/gists{/gist_id}","starred_url":"https://api.github.com/users/Dotokoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dotokoto/subscriptions","organizations_url":"https://api.github.com/users/Dotokoto/orgs","repos_url":"https://api.github.com/users/Dotokoto/repos","events_url":"https://api.github.com/users/Dotokoto/events{/privacy}","received_events_url":"https://api.github.com/users/Dotokoto/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-09T21:53:13Z","updated_at":"2015-11-15T10:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e5290d7fb5beb6c84d08914ed5506c3cd82cd70","assignee":{"login":"mangin","id":7918881,"avatar_url":"https://avatars.githubusercontent.com/u/7918881?v=3","gravatar_id":"","url":"https://api.github.com/users/mangin","html_url":"https://github.com/mangin","followers_url":"https://api.github.com/users/mangin/followers","following_url":"https://api.github.com/users/mangin/following{/other_user}","gists_url":"https://api.github.com/users/mangin/gists{/gist_id}","starred_url":"https://api.github.com/users/mangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangin/subscriptions","organizations_url":"https://api.github.com/users/mangin/orgs","repos_url":"https://api.github.com/users/mangin/repos","events_url":"https://api.github.com/users/mangin/events{/privacy}","received_events_url":"https://api.github.com/users/mangin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/26/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/statuses/4d3990cf2ffbe3bc45c1f82f1091b4ab360d70be","head":{"label":"Dotokoto:master","ref":"master","sha":"4d3990cf2ffbe3bc45c1f82f1091b4ab360d70be","user":{"login":"Dotokoto","id":8973726,"avatar_url":"https://avatars.githubusercontent.com/u/8973726?v=3","gravatar_id":"","url":"https://api.github.com/users/Dotokoto","html_url":"https://github.com/Dotokoto","followers_url":"https://api.github.com/users/Dotokoto/followers","following_url":"https://api.github.com/users/Dotokoto/following{/other_user}","gists_url":"https://api.github.com/users/Dotokoto/gists{/gist_id}","starred_url":"https://api.github.com/users/Dotokoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dotokoto/subscriptions","organizations_url":"https://api.github.com/users/Dotokoto/orgs","repos_url":"https://api.github.com/users/Dotokoto/repos","events_url":"https://api.github.com/users/Dotokoto/events{/privacy}","received_events_url":"https://api.github.com/users/Dotokoto/received_events","type":"User","site_admin":false},"repo":{"id":45780614,"name":"javascript-tasks-6","full_name":"Dotokoto/javascript-tasks-6","owner":{"login":"Dotokoto","id":8973726,"avatar_url":"https://avatars.githubusercontent.com/u/8973726?v=3","gravatar_id":"","url":"https://api.github.com/users/Dotokoto","html_url":"https://github.com/Dotokoto","followers_url":"https://api.github.com/users/Dotokoto/followers","following_url":"https://api.github.com/users/Dotokoto/following{/other_user}","gists_url":"https://api.github.com/users/Dotokoto/gists{/gist_id}","starred_url":"https://api.github.com/users/Dotokoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dotokoto/subscriptions","organizations_url":"https://api.github.com/users/Dotokoto/orgs","repos_url":"https://api.github.com/users/Dotokoto/repos","events_url":"https://api.github.com/users/Dotokoto/events{/privacy}","received_events_url":"https://api.github.com/users/Dotokoto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dotokoto/javascript-tasks-6","description":"Задача к лекции « Объекты, Date, Math» – «0b11 друзей Оушена»","fork":true,"url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6","forks_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/forks","keys_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/teams","hooks_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/hooks","issue_events_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/issues/events{/number}","events_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/events","assignees_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/assignees{/user}","branches_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/branches{/branch}","tags_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/tags","blobs_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/statuses/{sha}","languages_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/languages","stargazers_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/stargazers","contributors_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/contributors","subscribers_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/subscribers","subscription_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/subscription","commits_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/contents/{+path}","compare_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/merges","archive_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/downloads","issues_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/issues{/number}","pulls_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/pulls{/number}","milestones_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/milestones{/number}","notifications_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/labels{/name}","releases_url":"https://api.github.com/repos/Dotokoto/javascript-tasks-6/releases{/id}","created_at":"2015-11-08T13:01:06Z","updated_at":"2015-11-08T13:01:07Z","pushed_at":"2015-11-12T18:42:50Z","git_url":"git://github.com/Dotokoto/javascript-tasks-6.git","ssh_url":"git@github.com:Dotokoto/javascript-tasks-6.git","clone_url":"https://github.com/Dotokoto/javascript-tasks-6.git","svn_url":"https://github.com/Dotokoto/javascript-tasks-6","homepage":"","size":94,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"urfu-2015:master","ref":"master","sha":"a3e2b2a72420bc0195d457a39c732ae5151b04ea","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":45454584,"name":"javascript-tasks-6","full_name":"urfu-2015/javascript-tasks-6","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/javascript-tasks-6","description":"Задача к лекции « Объекты, Date, Math» – «0b11 друзей Оушена»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/releases{/id}","created_at":"2015-11-03T09:12:41Z","updated_at":"2015-11-03T14:38:37Z","pushed_at":"2015-11-14T21:06:21Z","git_url":"git://github.com/urfu-2015/javascript-tasks-6.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-6.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-6.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-6","homepage":"","size":1350,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":26,"forks":45,"open_issues":26,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-6/pull/26"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/26"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-6/statuses/4d3990cf2ffbe3bc45c1f82f1091b4ab360d70be"}}}}