{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2343","labels_url":"https://api.github.com/repos/moment/moment/issues/2343/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2343/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2343/events","html_url":"https://github.com/moment/moment/issues/2343","id":70457248,"number":2343,"title":"There doesn't seem to be a way to handle either 2 or 4 digit years","user":{"login":"stewartml","id":1624432,"avatar_url":"https://avatars.githubusercontent.com/u/1624432?v=3","gravatar_id":"","url":"https://api.github.com/users/stewartml","html_url":"https://github.com/stewartml","followers_url":"https://api.github.com/users/stewartml/followers","following_url":"https://api.github.com/users/stewartml/following{/other_user}","gists_url":"https://api.github.com/users/stewartml/gists{/gist_id}","starred_url":"https://api.github.com/users/stewartml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewartml/subscriptions","organizations_url":"https://api.github.com/users/stewartml/orgs","repos_url":"https://api.github.com/users/stewartml/repos","events_url":"https://api.github.com/users/stewartml/events{/privacy}","received_events_url":"https://api.github.com/users/stewartml/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/moment/moment/labels/Enhancement","name":"Enhancement","color":"fef2c0"},{"url":"https://api.github.com/repos/moment/moment/labels/todo","name":"todo","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-23T16:36:24Z","updated_at":"2015-05-15T16:08:38Z","closed_at":null,"body":"I feel that the following snippet:\r\n\r\n    moment('23/4/14', 'D/M/YYYY')\r\n\r\nought to return the date `2014-04-23` (using ISO for the avoidance of doubt), but instead it returns `0014-04-23`, which is pretty unlikely to have been what the user intended.  \r\n\r\nThe opposite way round:\r\n\r\n    moment('23/4/2014', 'D/M/YY')\r\n\r\ngives you `2020-04-23`, which isn't likely to have been what the user meant either...\r\n\r\nTo maintain backwards compatibility, perhaps there should be another format specifier, e.g. a single `Y` that doesn't care whether it gets a 2 digit year or a 4 digit year, and returns something sensible either way.\r\n\r\nI.e., I want to be able to parse the user input and not care whether they used a 4 digit year or a 2 digit year, and use some sensible rules to return the date the user expected."},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/102449753","html_url":"https://github.com/moment/moment/issues/2343#issuecomment-102449753","issue_url":"https://api.github.com/repos/moment/moment/issues/2343","id":102449753,"user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T16:08:38Z","updated_at":"2015-05-15T16:08:38Z","body":"@ppoisson parse it with an explicit format string as the second arg; right now you're just using the native `Date` constructor."}}