{"action":"created","issue":{"url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/7","labels_url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/7/comments","events_url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/7/events","html_url":"https://github.com/pbrisbin/friendly-time/pull/7","id":40360966,"number":7,"title":"Support \"from now\" for future dates","user":{"login":"league","id":50286,"avatar_url":"https://avatars.githubusercontent.com/u/50286?v=3","gravatar_id":"","url":"https://api.github.com/users/league","html_url":"https://github.com/league","followers_url":"https://api.github.com/users/league/followers","following_url":"https://api.github.com/users/league/following{/other_user}","gists_url":"https://api.github.com/users/league/gists{/gist_id}","starred_url":"https://api.github.com/users/league/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/league/subscriptions","organizations_url":"https://api.github.com/users/league/orgs","repos_url":"https://api.github.com/users/league/repos","events_url":"https://api.github.com/users/league/events{/privacy}","received_events_url":"https://api.github.com/users/league/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-08-15T16:11:59Z","updated_at":"2015-01-11T22:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pbrisbin/friendly-time/pulls/7","html_url":"https://github.com/pbrisbin/friendly-time/pull/7","diff_url":"https://github.com/pbrisbin/friendly-time/pull/7.diff","patch_url":"https://github.com/pbrisbin/friendly-time/pull/7.patch"},"body":"Unfortunately, this breaks the `HumanTimeLocale` interface for I18N,\r\nbecause many of the functions take a `Bool` to specify whether the date\r\nis in the future.\r\n\r\nAddresses #6."},"comment":{"url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/comments/69515055","html_url":"https://github.com/pbrisbin/friendly-time/pull/7#issuecomment-69515055","issue_url":"https://api.github.com/repos/pbrisbin/friendly-time/issues/7","id":69515055,"user":{"login":"cies","id":8694,"avatar_url":"https://avatars.githubusercontent.com/u/8694?v=3","gravatar_id":"","url":"https://api.github.com/users/cies","html_url":"https://github.com/cies","followers_url":"https://api.github.com/users/cies/followers","following_url":"https://api.github.com/users/cies/following{/other_user}","gists_url":"https://api.github.com/users/cies/gists{/gist_id}","starred_url":"https://api.github.com/users/cies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cies/subscriptions","organizations_url":"https://api.github.com/users/cies/orgs","repos_url":"https://api.github.com/users/cies/repos","events_url":"https://api.github.com/users/cies/events{/privacy}","received_events_url":"https://api.github.com/users/cies/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T22:29:29Z","updated_at":"2015-01-11T22:29:29Z","body":"Jups something like this is really flexible... Too flexible maybe, as I\r\nguess fromDurationEn will get loaded with guards: it will pretty much be a\r\nhuge list pattermatch/guards cotaining most of the logic of the lib.\r\n\r\nJust as an example:\r\n\r\nformatDurationEn (Duration Seconds Past i)\r\n  | i < 3 = \"just now\"\r\n  | otherwise = show i ++ \" seconds ago\"\r\nformatDurationEn (Duration Seconds Future i)\r\n  | i < 3 = \"about now\"\r\n  | otherwise = show i ++ \" seconds from now\"\r\n\r\nformatDurationEn (Duration Seconds Past i)\r\n  | i == 1 = \"about a minute ago\"\r\n  | otherwise = \"about \" ++ show i ++ \" minutes ago\"\r\n\r\n-- ...\r\n\r\n\r\nSo, you propose breaking friendly-time-i18n out of the current lib? (which\r\nthen can grow into a collection of translations)\r\n\r\nOn Sun, Jan 11, 2015 at 10:39 PM, pat brisbin <notifications@github.com>\r\nwrote:\r\n\r\n> All good points. I'm thinking about something like this:\r\n>\r\n> data Tense = Past | Future\r\n> data Unit = Seconds | Minutes | Hours | -- ...\r\n> data Duration = Duration Unit Tense Int -> String\r\n> formatDurationEn :: Duration -> String\r\n> formatDurationEn (Duration _ _ 0) = \"just now\"\r\n> formatDurationEn (Duration Seconds Past i) = show i ++ \" seconds ago\"\r\n> formatDurationEn (Duration Seconds Future i) = show i ++ \" seconds from now\"-- ...\r\n>\r\n> And,\r\n>\r\n> formatTime :: UTCTime -> String\r\n> formatTime = formatTimeWith formatDurationEn\r\n> formatTimeWith :: (Duration -> String) -> UTCTime -> String\r\n> formatTimeWith fmt = fmt . toDuration\r\n>\r\n> I would then expect a separate library to provide formatDurationI18n.\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/pbrisbin/friendly-time/pull/7#issuecomment-69512831>.\r\n>"}}