{"action":"created","issue":{"url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/33","labels_url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/33/comments","events_url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/33/events","html_url":"https://github.com/yahoo/intl-relativeformat/issues/33","id":90666328,"number":33,"title":"Add \"calendar\" style","user":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars.githubusercontent.com/u/141300?v=3","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-24T12:46:36Z","updated_at":"2015-06-25T07:14:15Z","closed_at":null,"body":"[Moment.js](http://momentjs.com/docs/#/displaying/calendar-time/) has a \"calendar\" style output, that works quite well in some situations. It would be awesome if this project would support that output style too.\r\n\r\ntime | output\r\n--- | ---\r\nLast week |\tLast Monday at 2:30 AM\r\nThe day before |\tYesterday at 2:30 AM\r\nThe same day |\tToday at 2:30 AM\r\nThe next day |\tTomorrow at 2:30 AM\r\nThe next week |\tSunday at 2:30 AM\r\nEverything else |\t7/10/2011"},"comment":{"url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/comments/115134605","html_url":"https://github.com/yahoo/intl-relativeformat/issues/33#issuecomment-115134605","issue_url":"https://api.github.com/repos/yahoo/intl-relativeformat/issues/33","id":115134605,"user":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars.githubusercontent.com/u/141300?v=3","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T07:14:15Z","updated_at":"2015-06-25T07:14:15Z","body":"@caridy I would mimic the [moment.js algo](https://github.com/moment/moment/blob/develop/src/lib/moment/calendar.js#L10-L15) for now:\r\n\r\n```js\r\n        format = diff < -6 ? 'sameElse' :\r\n            diff < -1 ? 'lastWeek' :\r\n            diff < 0 ? 'lastDay' :\r\n            diff < 1 ? 'sameDay' :\r\n            diff < 2 ? 'nextDay' :\r\n            diff < 7 ? 'nextWeek' : 'sameElse';\r\n```"}}