{"action":"closed","issue":{"url":"https://api.github.com/repos/clj-time/clj-time/issues/96","labels_url":"https://api.github.com/repos/clj-time/clj-time/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/clj-time/clj-time/issues/96/comments","events_url":"https://api.github.com/repos/clj-time/clj-time/issues/96/events","html_url":"https://github.com/clj-time/clj-time/issues/96","id":23102586,"number":96,"title":"Let `formatter` accept formatters (and/or keywords)","user":{"login":"leifp","id":708601,"avatar_url":"https://avatars.githubusercontent.com/u/708601?v=3","gravatar_id":"","url":"https://api.github.com/users/leifp","html_url":"https://github.com/leifp","followers_url":"https://api.github.com/users/leifp/followers","following_url":"https://api.github.com/users/leifp/following{/other_user}","gists_url":"https://api.github.com/users/leifp/gists{/gist_id}","starred_url":"https://api.github.com/users/leifp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leifp/subscriptions","organizations_url":"https://api.github.com/users/leifp/orgs","repos_url":"https://api.github.com/users/leifp/repos","events_url":"https://api.github.com/users/leifp/events{/privacy}","received_events_url":"https://api.github.com/users/leifp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-11-21T22:26:38Z","updated_at":"2015-11-24T19:58:58Z","closed_at":"2015-11-24T19:58:58Z","body":"This is an enhancement.\r\n\r\nWhen writing formatters that accept several formats:\r\n\r\n```clojure\r\n;; I'd like to write:\r\n(formatter (formatters :year-month-day)))\r\n;; => ClassCastException org.joda.time.format.DateTimeFormatter cannot\r\n;; be cast to java.lang.String  clj-time.format/formatter\r\n\r\n;; or even\r\n(formatter :year-month-day) ; use built-in automatically\r\n\r\n;; then I could say\r\n(formatter (default-time-zone) :year-month-day :basic-date \"YY/dd/MM\")\r\n```\r\n\r\nThe current code seems to try to avoid reflection, but I feel some is acceptable here, because hopefully a formatter will be constructed once and used many times."}}