{"action":"created","issue":{"url":"https://api.github.com/repos/dbushell/Pikaday/issues/290","labels_url":"https://api.github.com/repos/dbushell/Pikaday/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/dbushell/Pikaday/issues/290/comments","events_url":"https://api.github.com/repos/dbushell/Pikaday/issues/290/events","html_url":"https://github.com/dbushell/Pikaday/pull/290","id":68161204,"number":290,"title":"Add options flag for strict date parsing with moment","user":{"login":"zerofifteen","id":2309408,"avatar_url":"https://avatars.githubusercontent.com/u/2309408?v=3","gravatar_id":"","url":"https://api.github.com/users/zerofifteen","html_url":"https://github.com/zerofifteen","followers_url":"https://api.github.com/users/zerofifteen/followers","following_url":"https://api.github.com/users/zerofifteen/following{/other_user}","gists_url":"https://api.github.com/users/zerofifteen/gists{/gist_id}","starred_url":"https://api.github.com/users/zerofifteen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zerofifteen/subscriptions","organizations_url":"https://api.github.com/users/zerofifteen/orgs","repos_url":"https://api.github.com/users/zerofifteen/repos","events_url":"https://api.github.com/users/zerofifteen/events{/privacy}","received_events_url":"https://api.github.com/users/zerofifteen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-13T18:21:18Z","updated_at":"2015-09-30T10:27:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dbushell/Pikaday/pulls/290","html_url":"https://github.com/dbushell/Pikaday/pull/290","diff_url":"https://github.com/dbushell/Pikaday/pull/290.diff","patch_url":"https://github.com/dbushell/Pikaday/pull/290.patch"},"body":"Moment's default parser is very forgiving and translates user typed values into unexpected dates.\r\n\r\nIf the input format is set to \"MM/DD/YYYY\", and the user inputs \"test5\" ... Moment will convert the user input into \"05/01/2015\".\r\n\r\nThis flag enables Moment's strict parsing.\r\n"},"comment":{"url":"https://api.github.com/repos/dbushell/Pikaday/issues/comments/144348840","html_url":"https://github.com/dbushell/Pikaday/pull/290#issuecomment-144348840","issue_url":"https://api.github.com/repos/dbushell/Pikaday/issues/290","id":144348840,"user":{"login":"tilmanpotthof","id":157532,"avatar_url":"https://avatars.githubusercontent.com/u/157532?v=3","gravatar_id":"","url":"https://api.github.com/users/tilmanpotthof","html_url":"https://github.com/tilmanpotthof","followers_url":"https://api.github.com/users/tilmanpotthof/followers","following_url":"https://api.github.com/users/tilmanpotthof/following{/other_user}","gists_url":"https://api.github.com/users/tilmanpotthof/gists{/gist_id}","starred_url":"https://api.github.com/users/tilmanpotthof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilmanpotthof/subscriptions","organizations_url":"https://api.github.com/users/tilmanpotthof/orgs","repos_url":"https://api.github.com/users/tilmanpotthof/repos","events_url":"https://api.github.com/users/tilmanpotthof/events{/privacy}","received_events_url":"https://api.github.com/users/tilmanpotthof/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T10:27:03Z","updated_at":"2015-09-30T10:27:03Z","body":"As long as this issue is not release I have a workaround to set the strict parsing as default for moment.\r\n\r\n    (function (_, realMoment) {\r\n      'use strict';\r\n    \r\n      // patch moment to parse always strict\r\n      window.moment = function () {\r\n        if (arguments.length === 2) {\r\n          return realMoment.call(realMoment, arguments[0], arguments[1], true);\r\n        } else if (arguments.length === 3 && !_.isBoolean(arguments[2])) {\r\n          return realMoment.call(realMoment, arguments[0], arguments[1], arguments[2], true);\r\n        } else {\r\n          return realMoment.apply(realMoment, arguments);\r\n        }\r\n      };\r\n    \r\n      _.extend(window.moment, realMoment);\r\n    \r\n      if (console && console.warn) {\r\n        console.warn('moment.js strict patch - sets strict:true as hidden default parameter ' +\r\n          '(can be removed if this Pikaday Issue is fixed: https://github.com/dbushell/Pikaday/issues/414');\r\n      }\r\n    })(_, moment);\r\n"}}