{"action":"created","comment":{"url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/comments/71934651","id":71934651,"diff_hunk":"@@ -461,6 +461,54 @@ module.directive(\"mdpDatePicker\", [\"$mdpDatePicker\", \"$timeout\", function($mdpDa\n                 scope.$on(\"$destroy\", function() {\n                     inputElement.off(\"reset input blur\", onInputElementEvents);\n                 });\n+\n+                if(scope.dateFormat == \"MM/DD/YYYY\") {\n+                    inputElement.on(\"keypress\", formatDateAsTyped);\n+                }\n+\n+\n+                function formatDateAsTyped(event) {\n+                    var inputDate = this.value;\n+                    var unicode = event.keyCode ? event.keyCode : event.charCode;\n+\n+                    //Allow BackSpace, Del, left arrow, right arrow in firefox. IE, chrome, safari supports these keys\n+                    if (event.keyCode == 8 || event.keyCode == 46 || (event.keyCode == 37 && !event.charCode) || event.keyCode == 39) {\n+                        return true;\n+                    }\n+\n+                    if (isNumber(unicode) && inputDate.length < 10) {\n+                            //replaces 2 to 02, 3 to 03.. for month field..\n+                            inputDate = inputDate.replace(/^([2-9])/, \"0$1\");\n+                            //restrict typing 13, 14, 15, 16, 17, 18, 19 for month field\n+                            if(inputDate == \"1\" && (unicode >= 51 && unicode <= 57)) {\n+                            return false;\n+                            }\n+                            //replaces 4 to 04, 5 to 05.. for date field..\n+                            inputDate = inputDate.replace(/^([0-9])([0-9])(\\/)([4-9])/, \"$1$2$30$4\");\n+                            //restrict typing 2,3,4,5,6,7,8,9 in date field second position\n+                            if(inputDate.length == 4 && inputDate.charAt(3) == '3' && (unicode >= 50 && unicode <= 57)){\n+                            return false;\n+                            }\n+                            if (inputDate.length == 2 || inputDate.length == 5) {\n+                                inputDate = inputDate + \"/\";\n+                            }\n+                            this.value = inputDate;\n+                            return true;\n+                        } else {\n+                            return false;\n+                        }\n+                    }\n+\n+                function isNumber(unicode) {\n+                    var char = String.fromCharCode(unicode);\n+\n+                    if (((\"0123456789\").indexOf(char) > -1)) {\n+                        // accept input","path":"src/components/mdpDatePicker/mdpDatePicker.js","position":46,"original_position":46,"commit_id":"cc96519fc505bb91162430d3aec3e7ef913767f8","original_commit_id":"cc96519fc505bb91162430d3aec3e7ef913767f8","user":{"login":"BenArunski","id":11380063,"avatar_url":"https://avatars.githubusercontent.com/u/11380063?v=3","gravatar_id":"","url":"https://api.github.com/users/BenArunski","html_url":"https://github.com/BenArunski","followers_url":"https://api.github.com/users/BenArunski/followers","following_url":"https://api.github.com/users/BenArunski/following{/other_user}","gists_url":"https://api.github.com/users/BenArunski/gists{/gist_id}","starred_url":"https://api.github.com/users/BenArunski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenArunski/subscriptions","organizations_url":"https://api.github.com/users/BenArunski/orgs","repos_url":"https://api.github.com/users/BenArunski/repos","events_url":"https://api.github.com/users/BenArunski/events{/privacy}","received_events_url":"https://api.github.com/users/BenArunski/received_events","type":"User","site_admin":false},"body":"comment does not apply to the function.","created_at":"2016-07-22T19:42:36Z","updated_at":"2016-07-22T19:42:36Z","html_url":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3#discussion_r71934651","pull_request_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/comments/71934651"},"html":{"href":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3#discussion_r71934651"},"pull_request":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3","id":78259780,"html_url":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3","diff_url":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3.diff","patch_url":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3.patch","issue_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/3","number":3,"state":"open","locked":false,"title":"Date picker: masking date, Fixed code to not allow % key typed in dat…","user":{"login":"dmopuri","id":7999096,"avatar_url":"https://avatars.githubusercontent.com/u/7999096?v=3","gravatar_id":"","url":"https://api.github.com/users/dmopuri","html_url":"https://github.com/dmopuri","followers_url":"https://api.github.com/users/dmopuri/followers","following_url":"https://api.github.com/users/dmopuri/following{/other_user}","gists_url":"https://api.github.com/users/dmopuri/gists{/gist_id}","starred_url":"https://api.github.com/users/dmopuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmopuri/subscriptions","organizations_url":"https://api.github.com/users/dmopuri/orgs","repos_url":"https://api.github.com/users/dmopuri/repos","events_url":"https://api.github.com/users/dmopuri/events{/privacy}","received_events_url":"https://api.github.com/users/dmopuri/received_events","type":"User","site_admin":false},"body":"…e and time input fields","created_at":"2016-07-21T05:28:02Z","updated_at":"2016-07-22T19:42:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e9e3f667622e41a8f6585ecc35a1f0cb50599da","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3/commits","review_comments_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3/comments","review_comment_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/3/comments","statuses_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/statuses/cc96519fc505bb91162430d3aec3e7ef913767f8","head":{"label":"dmopuri:date_format","ref":"date_format","sha":"cc96519fc505bb91162430d3aec3e7ef913767f8","user":{"login":"dmopuri","id":7999096,"avatar_url":"https://avatars.githubusercontent.com/u/7999096?v=3","gravatar_id":"","url":"https://api.github.com/users/dmopuri","html_url":"https://github.com/dmopuri","followers_url":"https://api.github.com/users/dmopuri/followers","following_url":"https://api.github.com/users/dmopuri/following{/other_user}","gists_url":"https://api.github.com/users/dmopuri/gists{/gist_id}","starred_url":"https://api.github.com/users/dmopuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmopuri/subscriptions","organizations_url":"https://api.github.com/users/dmopuri/orgs","repos_url":"https://api.github.com/users/dmopuri/repos","events_url":"https://api.github.com/users/dmopuri/events{/privacy}","received_events_url":"https://api.github.com/users/dmopuri/received_events","type":"User","site_admin":false},"repo":{"id":63281004,"name":"mdPickers","full_name":"dmopuri/mdPickers","owner":{"login":"dmopuri","id":7999096,"avatar_url":"https://avatars.githubusercontent.com/u/7999096?v=3","gravatar_id":"","url":"https://api.github.com/users/dmopuri","html_url":"https://github.com/dmopuri","followers_url":"https://api.github.com/users/dmopuri/followers","following_url":"https://api.github.com/users/dmopuri/following{/other_user}","gists_url":"https://api.github.com/users/dmopuri/gists{/gist_id}","starred_url":"https://api.github.com/users/dmopuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmopuri/subscriptions","organizations_url":"https://api.github.com/users/dmopuri/orgs","repos_url":"https://api.github.com/users/dmopuri/repos","events_url":"https://api.github.com/users/dmopuri/events{/privacy}","received_events_url":"https://api.github.com/users/dmopuri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmopuri/mdPickers","description":"Material Design date/time pickers for Angular Material","fork":true,"url":"https://api.github.com/repos/dmopuri/mdPickers","forks_url":"https://api.github.com/repos/dmopuri/mdPickers/forks","keys_url":"https://api.github.com/repos/dmopuri/mdPickers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmopuri/mdPickers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmopuri/mdPickers/teams","hooks_url":"https://api.github.com/repos/dmopuri/mdPickers/hooks","issue_events_url":"https://api.github.com/repos/dmopuri/mdPickers/issues/events{/number}","events_url":"https://api.github.com/repos/dmopuri/mdPickers/events","assignees_url":"https://api.github.com/repos/dmopuri/mdPickers/assignees{/user}","branches_url":"https://api.github.com/repos/dmopuri/mdPickers/branches{/branch}","tags_url":"https://api.github.com/repos/dmopuri/mdPickers/tags","blobs_url":"https://api.github.com/repos/dmopuri/mdPickers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmopuri/mdPickers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmopuri/mdPickers/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmopuri/mdPickers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmopuri/mdPickers/statuses/{sha}","languages_url":"https://api.github.com/repos/dmopuri/mdPickers/languages","stargazers_url":"https://api.github.com/repos/dmopuri/mdPickers/stargazers","contributors_url":"https://api.github.com/repos/dmopuri/mdPickers/contributors","subscribers_url":"https://api.github.com/repos/dmopuri/mdPickers/subscribers","subscription_url":"https://api.github.com/repos/dmopuri/mdPickers/subscription","commits_url":"https://api.github.com/repos/dmopuri/mdPickers/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmopuri/mdPickers/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmopuri/mdPickers/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmopuri/mdPickers/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmopuri/mdPickers/contents/{+path}","compare_url":"https://api.github.com/repos/dmopuri/mdPickers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmopuri/mdPickers/merges","archive_url":"https://api.github.com/repos/dmopuri/mdPickers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmopuri/mdPickers/downloads","issues_url":"https://api.github.com/repos/dmopuri/mdPickers/issues{/number}","pulls_url":"https://api.github.com/repos/dmopuri/mdPickers/pulls{/number}","milestones_url":"https://api.github.com/repos/dmopuri/mdPickers/milestones{/number}","notifications_url":"https://api.github.com/repos/dmopuri/mdPickers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmopuri/mdPickers/labels{/name}","releases_url":"https://api.github.com/repos/dmopuri/mdPickers/releases{/id}","deployments_url":"https://api.github.com/repos/dmopuri/mdPickers/deployments","created_at":"2016-07-13T21:32:24Z","updated_at":"2016-07-13T21:32:25Z","pushed_at":"2016-07-21T05:27:19Z","git_url":"git://github.com/dmopuri/mdPickers.git","ssh_url":"git@github.com:dmopuri/mdPickers.git","clone_url":"https://github.com/dmopuri/mdPickers.git","svn_url":"https://github.com/dmopuri/mdPickers","homepage":"","size":383,"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":"CapstoneConsultingInc:master","ref":"master","sha":"d4056a0a3f6c8245ee0c0f490d074d1b5b2af43f","user":{"login":"CapstoneConsultingInc","id":1443539,"avatar_url":"https://avatars.githubusercontent.com/u/1443539?v=3","gravatar_id":"","url":"https://api.github.com/users/CapstoneConsultingInc","html_url":"https://github.com/CapstoneConsultingInc","followers_url":"https://api.github.com/users/CapstoneConsultingInc/followers","following_url":"https://api.github.com/users/CapstoneConsultingInc/following{/other_user}","gists_url":"https://api.github.com/users/CapstoneConsultingInc/gists{/gist_id}","starred_url":"https://api.github.com/users/CapstoneConsultingInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CapstoneConsultingInc/subscriptions","organizations_url":"https://api.github.com/users/CapstoneConsultingInc/orgs","repos_url":"https://api.github.com/users/CapstoneConsultingInc/repos","events_url":"https://api.github.com/users/CapstoneConsultingInc/events{/privacy}","received_events_url":"https://api.github.com/users/CapstoneConsultingInc/received_events","type":"Organization","site_admin":false},"repo":{"id":63709466,"name":"mdPickers","full_name":"CapstoneConsultingInc/mdPickers","owner":{"login":"CapstoneConsultingInc","id":1443539,"avatar_url":"https://avatars.githubusercontent.com/u/1443539?v=3","gravatar_id":"","url":"https://api.github.com/users/CapstoneConsultingInc","html_url":"https://github.com/CapstoneConsultingInc","followers_url":"https://api.github.com/users/CapstoneConsultingInc/followers","following_url":"https://api.github.com/users/CapstoneConsultingInc/following{/other_user}","gists_url":"https://api.github.com/users/CapstoneConsultingInc/gists{/gist_id}","starred_url":"https://api.github.com/users/CapstoneConsultingInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CapstoneConsultingInc/subscriptions","organizations_url":"https://api.github.com/users/CapstoneConsultingInc/orgs","repos_url":"https://api.github.com/users/CapstoneConsultingInc/repos","events_url":"https://api.github.com/users/CapstoneConsultingInc/events{/privacy}","received_events_url":"https://api.github.com/users/CapstoneConsultingInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CapstoneConsultingInc/mdPickers","description":"Material Design date/time pickers for Angular Material","fork":true,"url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers","forks_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/forks","keys_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/teams","hooks_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/hooks","issue_events_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/events{/number}","events_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/events","assignees_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/assignees{/user}","branches_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/branches{/branch}","tags_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/tags","blobs_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/git/refs{/sha}","trees_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/statuses/{sha}","languages_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/languages","stargazers_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/stargazers","contributors_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/contributors","subscribers_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/subscribers","subscription_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/subscription","commits_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/commits{/sha}","git_commits_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/git/commits{/sha}","comments_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/comments{/number}","issue_comment_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/comments{/number}","contents_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/contents/{+path}","compare_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/merges","archive_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/downloads","issues_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues{/number}","pulls_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls{/number}","milestones_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/milestones{/number}","notifications_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/labels{/name}","releases_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/releases{/id}","deployments_url":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/deployments","created_at":"2016-07-19T16:13:41Z","updated_at":"2016-07-20T21:23:36Z","pushed_at":"2016-07-21T05:28:02Z","git_url":"git://github.com/CapstoneConsultingInc/mdPickers.git","ssh_url":"git@github.com:CapstoneConsultingInc/mdPickers.git","clone_url":"https://github.com/CapstoneConsultingInc/mdPickers.git","svn_url":"https://github.com/CapstoneConsultingInc/mdPickers","homepage":"","size":394,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3"},"html":{"href":"https://github.com/CapstoneConsultingInc/mdPickers/pull/3"},"issue":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/3"},"comments":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/CapstoneConsultingInc/mdPickers/statuses/cc96519fc505bb91162430d3aec3e7ef913767f8"}}}}
{"actor":{"display_login":"BenArunski"}}