{"action":"opened","issue":{"url":"https://api.github.com/repos/inukshuk/edtf.js/issues/2","repository_url":"https://api.github.com/repos/inukshuk/edtf.js","labels_url":"https://api.github.com/repos/inukshuk/edtf.js/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/inukshuk/edtf.js/issues/2/comments","events_url":"https://api.github.com/repos/inukshuk/edtf.js/issues/2/events","html_url":"https://github.com/inukshuk/edtf.js/issues/2","id":164262847,"number":2,"title":"Max property of masked dates incorrect","user":{"login":"stevetweeddale","id":506503,"avatar_url":"https://avatars.githubusercontent.com/u/506503?v=3","gravatar_id":"","url":"https://api.github.com/users/stevetweeddale","html_url":"https://github.com/stevetweeddale","followers_url":"https://api.github.com/users/stevetweeddale/followers","following_url":"https://api.github.com/users/stevetweeddale/following{/other_user}","gists_url":"https://api.github.com/users/stevetweeddale/gists{/gist_id}","starred_url":"https://api.github.com/users/stevetweeddale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevetweeddale/subscriptions","organizations_url":"https://api.github.com/users/stevetweeddale/orgs","repos_url":"https://api.github.com/users/stevetweeddale/repos","events_url":"https://api.github.com/users/stevetweeddale/events{/privacy}","received_events_url":"https://api.github.com/users/stevetweeddale/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-07T09:07:17Z","updated_at":"2016-07-07T09:07:17Z","closed_at":null,"body":"As far as I understand it, the maximum possible extent of `20XX` would be the last second of the year 2099. However it's parse as if it has year precision, so `next()` gives the year 2001, and `.max` gives you the year 2001 - 1 millisecond.\r\n\r\n```\r\n> new Date(edtf('20XX').max)\r\n2000-12-31T23:59:59.999Z\r\n> new Date(edtf('20XX').min)\r\n2000-01-01T00:00:00.000Z\r\n```\r\n\r\nLooking at the code, I think this would need a bit of a refactor, with the introduction of a secondary notion of precision. Whereas currently it just knows \"how many date parts we have provided\" it would need to know which the most precise digit before any unknown ones is. So in this case, `20XX` feels like it ought to be treated as a century instead of a year, whilst `201X` would be a decade."}}
{"actor":{"display_login":"stevetweeddale"}}