{"action":"opened","issue":{"url":"https://api.github.com/repos/dart-lang/intl/issues/80","labels_url":"https://api.github.com/repos/dart-lang/intl/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/intl/issues/80/comments","events_url":"https://api.github.com/repos/dart-lang/intl/issues/80/events","html_url":"https://github.com/dart-lang/intl/issues/80","id":111295481,"number":80,"title":"DateFormat.parseLoose() incorrectly handles unexpected delimiters","user":{"login":"cpelling","id":15113338,"avatar_url":"https://avatars.githubusercontent.com/u/15113338?v=3","gravatar_id":"","url":"https://api.github.com/users/cpelling","html_url":"https://github.com/cpelling","followers_url":"https://api.github.com/users/cpelling/followers","following_url":"https://api.github.com/users/cpelling/following{/other_user}","gists_url":"https://api.github.com/users/cpelling/gists{/gist_id}","starred_url":"https://api.github.com/users/cpelling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpelling/subscriptions","organizations_url":"https://api.github.com/users/cpelling/orgs","repos_url":"https://api.github.com/users/cpelling/repos","events_url":"https://api.github.com/users/cpelling/events{/privacy}","received_events_url":"https://api.github.com/users/cpelling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-13T23:54:56Z","updated_at":"2015-10-13T23:54:56Z","closed_at":null,"body":"```dart\r\nnew DateFormat('yyyy-MM-dd').parseLoose(\"1/11\"); // returns 0001-11-1\r\n```\r\n\r\nThe above invocation of parseLoose() should fail with a FormatException, but instead returns November 1st, 1 A.D.\r\n\r\nI've looked into this a little and have identified two contributing causes:\r\n\r\n* When _DateFormatField.parseLiteralLoose() encounters an unexpected delimiter (such as a '/' instead of a '-'), it does nothing and allows parsing to continue. It should either throw a FormatException, or allow substitution of the delimiter but read past it.\r\n* _Stream.nextInteger() skips leading punctuation and doesn't advance the stream far enough to account for this. It should either throw a FormatException if the stream does not start with a number, or advance the stream past the end of the number that is actually parsed."}}