{"action":"created","issue":{"url":"https://api.github.com/repos/97jaz/gregor/issues/25","repository_url":"https://api.github.com/repos/97jaz/gregor","labels_url":"https://api.github.com/repos/97jaz/gregor/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/97jaz/gregor/issues/25/comments","events_url":"https://api.github.com/repos/97jaz/gregor/issues/25/events","html_url":"https://github.com/97jaz/gregor/issues/25","id":267749295,"number":25,"title":"`parse-moment` doesn't work with CLDR pattern that includes `z`?","user":{"login":"mbutterick","id":1425051,"avatar_url":"https://avatars0.githubusercontent.com/u/1425051?v=4","gravatar_id":"","url":"https://api.github.com/users/mbutterick","html_url":"https://github.com/mbutterick","followers_url":"https://api.github.com/users/mbutterick/followers","following_url":"https://api.github.com/users/mbutterick/following{/other_user}","gists_url":"https://api.github.com/users/mbutterick/gists{/gist_id}","starred_url":"https://api.github.com/users/mbutterick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbutterick/subscriptions","organizations_url":"https://api.github.com/users/mbutterick/orgs","repos_url":"https://api.github.com/users/mbutterick/repos","events_url":"https://api.github.com/users/mbutterick/events{/privacy}","received_events_url":"https://api.github.com/users/mbutterick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-10-23T17:19:47Z","updated_at":"2017-10-23T18:51:23Z","closed_at":null,"author_association":"NONE","body":"According to the docs, `parse-moment` “Parses `str` according to `pattern`, which uses the CLDR pattern syntax … If the input cannot be parsed as a moment, `exn:gregor:parse` is raised.”\r\n\r\n`z` [is part](http://unicode.org/reports/tr35/tr35-dates.html#dfst-zone) of the CLDR pattern syntax. Yet passing a pattern with `z` raises an error:\r\n\r\nWorks:\r\n\r\n```racket\r\n(require gregor)\r\n(define pat \"LLLL d, y\")\r\n;; I expect this to convert `now/moment` to a string, and then back to a moment\r\n(parse-moment (~t (now/moment) pat) pat)\r\n```\r\n\r\nDoes not work:\r\n\r\n```racket\r\n(require gregor)\r\n(define pat+z \"LLLL d, y z\")\r\n(parse-moment (~t (now/moment) pat+z) pat+z)\r\n```\r\n\r\nMoreover, the error raised is not of type `exn:gregor:parse`, but rather `exn:misc:match`."},"comment":{"url":"https://api.github.com/repos/97jaz/gregor/issues/comments/338759938","html_url":"https://github.com/97jaz/gregor/issues/25#issuecomment-338759938","issue_url":"https://api.github.com/repos/97jaz/gregor/issues/25","id":338759938,"user":{"login":"mbutterick","id":1425051,"avatar_url":"https://avatars0.githubusercontent.com/u/1425051?v=4","gravatar_id":"","url":"https://api.github.com/users/mbutterick","html_url":"https://github.com/mbutterick","followers_url":"https://api.github.com/users/mbutterick/followers","following_url":"https://api.github.com/users/mbutterick/following{/other_user}","gists_url":"https://api.github.com/users/mbutterick/gists{/gist_id}","starred_url":"https://api.github.com/users/mbutterick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbutterick/subscriptions","organizations_url":"https://api.github.com/users/mbutterick/orgs","repos_url":"https://api.github.com/users/mbutterick/repos","events_url":"https://api.github.com/users/mbutterick/events{/privacy}","received_events_url":"https://api.github.com/users/mbutterick/received_events","type":"User","site_admin":false},"created_at":"2017-10-23T18:51:23Z","updated_at":"2017-10-23T18:51:23Z","author_association":"NONE","body":"The CLDR rules seem to acknowledge the many ambiguities and then [punt entirely](http://unicode.org/reports/tr35/tr35-dates.html#Parsing_Dates_Times) on specifics: when parsing, it can be “especially complicated … to figure out what the user meant.” You don’t say.\r\n\r\nFWIW I don't mind if `gregor` only handles a subset of CLDR — using `Z` rather than `z` is no hardship — though it would be helpful if the docs mentioned the omissions."}}
{"actor":{"display_login":"mbutterick"}}