{"action":"created","comment":{"url":"https://api.github.com/repos/graphql/graphql-js/pulls/comments/87354788","pull_request_review_id":7969336,"id":87354788,"diff_hunk":"@@ -36,7 +36,8 @@\n     \"prepublish\": \". ./resources/prepublish.sh\"\n   },\n   \"dependencies\": {\n-    \"iterall\": \"1.0.2\"\n+    \"iterall\": \"1.0.2\",\n+    \"moment\": \"^2.15.2\"","path":"package.json","position":6,"original_position":6,"commit_id":"a3ac4ccb813e0aed918690443364328be44762d2","original_commit_id":"a3ac4ccb813e0aed918690443364328be44762d2","user":{"login":"excitement-engineer","id":19558321,"avatar_url":"https://avatars.githubusercontent.com/u/19558321?v=3","gravatar_id":"","url":"https://api.github.com/users/excitement-engineer","html_url":"https://github.com/excitement-engineer","followers_url":"https://api.github.com/users/excitement-engineer/followers","following_url":"https://api.github.com/users/excitement-engineer/following{/other_user}","gists_url":"https://api.github.com/users/excitement-engineer/gists{/gist_id}","starred_url":"https://api.github.com/users/excitement-engineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excitement-engineer/subscriptions","organizations_url":"https://api.github.com/users/excitement-engineer/orgs","repos_url":"https://api.github.com/users/excitement-engineer/repos","events_url":"https://api.github.com/users/excitement-engineer/events{/privacy}","received_events_url":"https://api.github.com/users/excitement-engineer/received_events","type":"User","site_admin":false},"body":"I completely agree with you on this one! I had some doubts about whether to include `moment` as a dependency because it is only used for a very small proportion of the code. There are some features of `moment` that I used:\r\n\r\n- Checking for a valid date is very easy using the `isValid()` function. I ran into the problem that the invalid date `2015-02-29` was regarded as a valid date in the `Date` object (because days are numbered from 1-31).\r\n- Checking for correctly formatted date strings is very easy in `moment` (you can specify an array of valid date formats). I initially tried using a single validating regex to validate all the supported date formats but it quickly became too complex to understand. \r\n\r\nI will try to overcome these problems:) I will try to write multiple easy to understand validating regex for verifying that the date string being parsed is in ISO date format and remove the `moment` dependency.\r\n\r\nI think that the important thing when doing these operations that the code remains readable and understandable. So I will make sure to write code this way:)","created_at":"2016-11-10T09:18:30Z","updated_at":"2016-11-10T09:18:30Z","html_url":"https://github.com/graphql/graphql-js/pull/557#discussion_r87354788","pull_request_url":"https://api.github.com/repos/graphql/graphql-js/pulls/557","_links":{"self":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/comments/87354788"},"html":{"href":"https://github.com/graphql/graphql-js/pull/557#discussion_r87354788"},"pull_request":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/557"}}},"pull_request":{"url":"https://api.github.com/repos/graphql/graphql-js/pulls/557","id":92466055,"html_url":"https://github.com/graphql/graphql-js/pull/557","diff_url":"https://github.com/graphql/graphql-js/pull/557.diff","patch_url":"https://github.com/graphql/graphql-js/pull/557.patch","issue_url":"https://api.github.com/repos/graphql/graphql-js/issues/557","number":557,"state":"open","locked":false,"title":"Initial proposal for the experimental GraphQLDateTime scalar","user":{"login":"excitement-engineer","id":19558321,"avatar_url":"https://avatars.githubusercontent.com/u/19558321?v=3","gravatar_id":"","url":"https://api.github.com/users/excitement-engineer","html_url":"https://github.com/excitement-engineer","followers_url":"https://api.github.com/users/excitement-engineer/followers","following_url":"https://api.github.com/users/excitement-engineer/following{/other_user}","gists_url":"https://api.github.com/users/excitement-engineer/gists{/gist_id}","starred_url":"https://api.github.com/users/excitement-engineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excitement-engineer/subscriptions","organizations_url":"https://api.github.com/users/excitement-engineer/orgs","repos_url":"https://api.github.com/users/excitement-engineer/repos","events_url":"https://api.github.com/users/excitement-engineer/events{/privacy}","received_events_url":"https://api.github.com/users/excitement-engineer/received_events","type":"User","site_admin":false},"body":"This PR contains an initial proposal for a graphQL `DateTime` scalar following the discussion in issue #550. Let me know what you think:)\r\n\r\n**The scalar has the following properties:**\r\n\r\n- It follows the **ISO 8601** date specification. \r\n- All dates are represented in **UTC**.\r\n- It **serializes javascript Date instances into ISO 8601 date strings** in the format `YYYY-MM-DDThh:mm:ss.sssZ`.\r\n- It **parses date strings into javascript Date instances**. The following formats are supported for the date strings: \r\n\r\n```\r\n'YYYY',\r\n'YYYY-MM',\r\n'YYYY-MM-DD',\r\n'YYYYMMDD',\r\n'YYYY-MM-DDThhZ',\r\n'YYYY-MM-DDThh:mmZ',\r\n'YYYY-MM-DDThhmmZ',\r\n'YYYY-MM-DDThh:mm:ssZ',\r\n'YYYY-MM-DDThhmmssZ',\r\n'YYYY-MM-DDThh:mm:ss.sssZ',\r\n'YYYY-MM-DDThhmmss.sssZ',\r\n'YYYY-Www',\r\n'YYYYWww',\r\n'YYYY-Www-D',\r\n'YYYYWwwD',\r\n'YYYY-DDD',\r\n'YYYYDDD'\r\n```\r\n\r\n- I had to include `moment` as a dependency in order to perform all the date operations.\r\n\r\n> The list of supported date formats was retrieved from [wikipedia](https://en.wikipedia.org/wiki/ISO_8601).\r\n\r\n> On wikipedia they mentioned that `±YYYYY` is used _\"To represent years before 0000 or after 9999, the standard also permits the expansion of the year representation but only by prior agreement between the sender and the receiver.\"_. From this description I concluded that this format is not in the standard ISO 8601 spec so I did not include it in the scalar.","created_at":"2016-11-05T20:26:01Z","updated_at":"2016-11-10T09:18:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b3977488655ea98b86fefbb7718a58b096b970c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/graphql/graphql-js/pulls/557/commits","review_comments_url":"https://api.github.com/repos/graphql/graphql-js/pulls/557/comments","review_comment_url":"https://api.github.com/repos/graphql/graphql-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql/graphql-js/issues/557/comments","statuses_url":"https://api.github.com/repos/graphql/graphql-js/statuses/a3ac4ccb813e0aed918690443364328be44762d2","head":{"label":"excitement-engineer:master","ref":"master","sha":"a3ac4ccb813e0aed918690443364328be44762d2","user":{"login":"excitement-engineer","id":19558321,"avatar_url":"https://avatars.githubusercontent.com/u/19558321?v=3","gravatar_id":"","url":"https://api.github.com/users/excitement-engineer","html_url":"https://github.com/excitement-engineer","followers_url":"https://api.github.com/users/excitement-engineer/followers","following_url":"https://api.github.com/users/excitement-engineer/following{/other_user}","gists_url":"https://api.github.com/users/excitement-engineer/gists{/gist_id}","starred_url":"https://api.github.com/users/excitement-engineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excitement-engineer/subscriptions","organizations_url":"https://api.github.com/users/excitement-engineer/orgs","repos_url":"https://api.github.com/users/excitement-engineer/repos","events_url":"https://api.github.com/users/excitement-engineer/events{/privacy}","received_events_url":"https://api.github.com/users/excitement-engineer/received_events","type":"User","site_admin":false},"repo":{"id":72913335,"name":"graphql-js","full_name":"excitement-engineer/graphql-js","owner":{"login":"excitement-engineer","id":19558321,"avatar_url":"https://avatars.githubusercontent.com/u/19558321?v=3","gravatar_id":"","url":"https://api.github.com/users/excitement-engineer","html_url":"https://github.com/excitement-engineer","followers_url":"https://api.github.com/users/excitement-engineer/followers","following_url":"https://api.github.com/users/excitement-engineer/following{/other_user}","gists_url":"https://api.github.com/users/excitement-engineer/gists{/gist_id}","starred_url":"https://api.github.com/users/excitement-engineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excitement-engineer/subscriptions","organizations_url":"https://api.github.com/users/excitement-engineer/orgs","repos_url":"https://api.github.com/users/excitement-engineer/repos","events_url":"https://api.github.com/users/excitement-engineer/events{/privacy}","received_events_url":"https://api.github.com/users/excitement-engineer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/excitement-engineer/graphql-js","description":"A reference implementation of GraphQL for JavaScript","fork":true,"url":"https://api.github.com/repos/excitement-engineer/graphql-js","forks_url":"https://api.github.com/repos/excitement-engineer/graphql-js/forks","keys_url":"https://api.github.com/repos/excitement-engineer/graphql-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/excitement-engineer/graphql-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/excitement-engineer/graphql-js/teams","hooks_url":"https://api.github.com/repos/excitement-engineer/graphql-js/hooks","issue_events_url":"https://api.github.com/repos/excitement-engineer/graphql-js/issues/events{/number}","events_url":"https://api.github.com/repos/excitement-engineer/graphql-js/events","assignees_url":"https://api.github.com/repos/excitement-engineer/graphql-js/assignees{/user}","branches_url":"https://api.github.com/repos/excitement-engineer/graphql-js/branches{/branch}","tags_url":"https://api.github.com/repos/excitement-engineer/graphql-js/tags","blobs_url":"https://api.github.com/repos/excitement-engineer/graphql-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/excitement-engineer/graphql-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/excitement-engineer/graphql-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/excitement-engineer/graphql-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/excitement-engineer/graphql-js/statuses/{sha}","languages_url":"https://api.github.com/repos/excitement-engineer/graphql-js/languages","stargazers_url":"https://api.github.com/repos/excitement-engineer/graphql-js/stargazers","contributors_url":"https://api.github.com/repos/excitement-engineer/graphql-js/contributors","subscribers_url":"https://api.github.com/repos/excitement-engineer/graphql-js/subscribers","subscription_url":"https://api.github.com/repos/excitement-engineer/graphql-js/subscription","commits_url":"https://api.github.com/repos/excitement-engineer/graphql-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/excitement-engineer/graphql-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/excitement-engineer/graphql-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/excitement-engineer/graphql-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/excitement-engineer/graphql-js/contents/{+path}","compare_url":"https://api.github.com/repos/excitement-engineer/graphql-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/excitement-engineer/graphql-js/merges","archive_url":"https://api.github.com/repos/excitement-engineer/graphql-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/excitement-engineer/graphql-js/downloads","issues_url":"https://api.github.com/repos/excitement-engineer/graphql-js/issues{/number}","pulls_url":"https://api.github.com/repos/excitement-engineer/graphql-js/pulls{/number}","milestones_url":"https://api.github.com/repos/excitement-engineer/graphql-js/milestones{/number}","notifications_url":"https://api.github.com/repos/excitement-engineer/graphql-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/excitement-engineer/graphql-js/labels{/name}","releases_url":"https://api.github.com/repos/excitement-engineer/graphql-js/releases{/id}","deployments_url":"https://api.github.com/repos/excitement-engineer/graphql-js/deployments","created_at":"2016-11-05T08:12:01Z","updated_at":"2016-11-05T08:12:03Z","pushed_at":"2016-11-05T20:04:23Z","git_url":"git://github.com/excitement-engineer/graphql-js.git","ssh_url":"git@github.com:excitement-engineer/graphql-js.git","clone_url":"https://github.com/excitement-engineer/graphql-js.git","svn_url":"https://github.com/excitement-engineer/graphql-js","homepage":"http://graphql.org/graphql-js/","size":1539,"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":"graphql:master","ref":"master","sha":"87a64689e85397144527e483cb7786b82e360a55","user":{"login":"graphql","id":12972006,"avatar_url":"https://avatars.githubusercontent.com/u/12972006?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql","html_url":"https://github.com/graphql","followers_url":"https://api.github.com/users/graphql/followers","following_url":"https://api.github.com/users/graphql/following{/other_user}","gists_url":"https://api.github.com/users/graphql/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql/subscriptions","organizations_url":"https://api.github.com/users/graphql/orgs","repos_url":"https://api.github.com/users/graphql/repos","events_url":"https://api.github.com/users/graphql/events{/privacy}","received_events_url":"https://api.github.com/users/graphql/received_events","type":"Organization","site_admin":false},"repo":{"id":38307428,"name":"graphql-js","full_name":"graphql/graphql-js","owner":{"login":"graphql","id":12972006,"avatar_url":"https://avatars.githubusercontent.com/u/12972006?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql","html_url":"https://github.com/graphql","followers_url":"https://api.github.com/users/graphql/followers","following_url":"https://api.github.com/users/graphql/following{/other_user}","gists_url":"https://api.github.com/users/graphql/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql/subscriptions","organizations_url":"https://api.github.com/users/graphql/orgs","repos_url":"https://api.github.com/users/graphql/repos","events_url":"https://api.github.com/users/graphql/events{/privacy}","received_events_url":"https://api.github.com/users/graphql/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql/graphql-js","description":"A reference implementation of GraphQL for JavaScript","fork":false,"url":"https://api.github.com/repos/graphql/graphql-js","forks_url":"https://api.github.com/repos/graphql/graphql-js/forks","keys_url":"https://api.github.com/repos/graphql/graphql-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql/graphql-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql/graphql-js/teams","hooks_url":"https://api.github.com/repos/graphql/graphql-js/hooks","issue_events_url":"https://api.github.com/repos/graphql/graphql-js/issues/events{/number}","events_url":"https://api.github.com/repos/graphql/graphql-js/events","assignees_url":"https://api.github.com/repos/graphql/graphql-js/assignees{/user}","branches_url":"https://api.github.com/repos/graphql/graphql-js/branches{/branch}","tags_url":"https://api.github.com/repos/graphql/graphql-js/tags","blobs_url":"https://api.github.com/repos/graphql/graphql-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql/graphql-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql/graphql-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql/graphql-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql/graphql-js/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql/graphql-js/languages","stargazers_url":"https://api.github.com/repos/graphql/graphql-js/stargazers","contributors_url":"https://api.github.com/repos/graphql/graphql-js/contributors","subscribers_url":"https://api.github.com/repos/graphql/graphql-js/subscribers","subscription_url":"https://api.github.com/repos/graphql/graphql-js/subscription","commits_url":"https://api.github.com/repos/graphql/graphql-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql/graphql-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql/graphql-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql/graphql-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql/graphql-js/contents/{+path}","compare_url":"https://api.github.com/repos/graphql/graphql-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql/graphql-js/merges","archive_url":"https://api.github.com/repos/graphql/graphql-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql/graphql-js/downloads","issues_url":"https://api.github.com/repos/graphql/graphql-js/issues{/number}","pulls_url":"https://api.github.com/repos/graphql/graphql-js/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql/graphql-js/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql/graphql-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql/graphql-js/labels{/name}","releases_url":"https://api.github.com/repos/graphql/graphql-js/releases{/id}","deployments_url":"https://api.github.com/repos/graphql/graphql-js/deployments","created_at":"2015-06-30T12:16:50Z","updated_at":"2016-11-10T07:03:05Z","pushed_at":"2016-11-10T04:29:05Z","git_url":"git://github.com/graphql/graphql-js.git","ssh_url":"git@github.com:graphql/graphql-js.git","clone_url":"https://github.com/graphql/graphql-js.git","svn_url":"https://github.com/graphql/graphql-js","homepage":"http://graphql.org/graphql-js/","size":1960,"stargazers_count":4905,"watchers_count":4905,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":361,"mirror_url":null,"open_issues_count":57,"forks":361,"open_issues":57,"watchers":4905,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/557"},"html":{"href":"https://github.com/graphql/graphql-js/pull/557"},"issue":{"href":"https://api.github.com/repos/graphql/graphql-js/issues/557"},"comments":{"href":"https://api.github.com/repos/graphql/graphql-js/issues/557/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/557/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql/graphql-js/pulls/557/commits"},"statuses":{"href":"https://api.github.com/repos/graphql/graphql-js/statuses/a3ac4ccb813e0aed918690443364328be44762d2"}}}}
{"actor":{"display_login":"excitement-engineer"}}