{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5456","repository_url":"https://api.github.com/repos/angular-ui/bootstrap","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5456/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5456/comments","events_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5456/events","html_url":"https://github.com/angular-ui/bootstrap/issues/5456","id":132536053,"number":5456,"title":"Datepicker popup - handle json ISO 8601 date strings","user":{"login":"RobJacobs","id":4559806,"avatar_url":"https://avatars.githubusercontent.com/u/4559806?v=3","gravatar_id":"","url":"https://api.github.com/users/RobJacobs","html_url":"https://github.com/RobJacobs","followers_url":"https://api.github.com/users/RobJacobs/followers","following_url":"https://api.github.com/users/RobJacobs/following{/other_user}","gists_url":"https://api.github.com/users/RobJacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/RobJacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobJacobs/subscriptions","organizations_url":"https://api.github.com/users/RobJacobs/orgs","repos_url":"https://api.github.com/users/RobJacobs/repos","events_url":"https://api.github.com/users/RobJacobs/events{/privacy}","received_events_url":"https://api.github.com/users/RobJacobs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-09T21:15:00Z","updated_at":"2016-03-02T18:21:56Z","closed_at":"2016-02-09T23:11:34Z","body":"I know there's been a lot of work done for parsing dates in the datepicker-popup, so please excuse me if I'm opening old wounds.  The change I propose would be to parse the ISO 8601 date string used in json to a date object.  I think this would cover most of the use cases and alleviate the majority of the feedback in regards to the datepicker-popup ng-model requiring a date object.  The change would involve adding the following snippet [here](https://github.com/angular-ui/bootstrap/blob/master/src/datepicker/datepicker.js#L923)\r\n\r\n        if (ISO_8601_DATE_REGEX.test(value)) {\r\n          value = new Date(value);\r\n        }\r\n\r\nAnd the regex would look like so:\r\n\r\n        var ISO_8601_DATE_REGEX = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\nLet me know if this is acceptable and I will create a PR, thanks."},"comment":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/comments/191358509","html_url":"https://github.com/angular-ui/bootstrap/issues/5456#issuecomment-191358509","issue_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/5456","id":191358509,"user":{"login":"togakangaroo","id":66150,"avatar_url":"https://avatars.githubusercontent.com/u/66150?v=3","gravatar_id":"","url":"https://api.github.com/users/togakangaroo","html_url":"https://github.com/togakangaroo","followers_url":"https://api.github.com/users/togakangaroo/followers","following_url":"https://api.github.com/users/togakangaroo/following{/other_user}","gists_url":"https://api.github.com/users/togakangaroo/gists{/gist_id}","starred_url":"https://api.github.com/users/togakangaroo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/togakangaroo/subscriptions","organizations_url":"https://api.github.com/users/togakangaroo/orgs","repos_url":"https://api.github.com/users/togakangaroo/repos","events_url":"https://api.github.com/users/togakangaroo/events{/privacy}","received_events_url":"https://api.github.com/users/togakangaroo/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T18:21:56Z","updated_at":"2016-03-02T18:21:56Z","body":"They can't be arbitrary, iso is a standard\r\n\r\nI'm trying to think of examples where timezone could possibly be an issue for a datepicker and all I got is if the server is running on one side of the international date line and is visited by someone in fiji during the southern summer? Even then, the offset is part of the standard and can be parsed out as easily as the other stuff. \r\n\r\nMaybe I'm missing something but this really sounds like 3 lines of code. Can you help me understand with a counterexample?"}}