{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/18335","labels_url":"https://api.github.com/repos/rails/rails/issues/18335/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/18335/comments","events_url":"https://api.github.com/repos/rails/rails/issues/18335/events","html_url":"https://github.com/rails/rails/pull/18335","id":53355860,"number":18335,"title":"Add #weekend?, #next_weekday, and #prev_weekday methods to Date, Time, and DateTime","user":{"login":"georgeclaghorn","id":94129,"avatar_url":"https://avatars.githubusercontent.com/u/94129?v=3","gravatar_id":"","url":"https://api.github.com/users/georgeclaghorn","html_url":"https://github.com/georgeclaghorn","followers_url":"https://api.github.com/users/georgeclaghorn/followers","following_url":"https://api.github.com/users/georgeclaghorn/following{/other_user}","gists_url":"https://api.github.com/users/georgeclaghorn/gists{/gist_id}","starred_url":"https://api.github.com/users/georgeclaghorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgeclaghorn/subscriptions","organizations_url":"https://api.github.com/users/georgeclaghorn/orgs","repos_url":"https://api.github.com/users/georgeclaghorn/repos","events_url":"https://api.github.com/users/georgeclaghorn/events{/privacy}","received_events_url":"https://api.github.com/users/georgeclaghorn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-05T01:13:46Z","updated_at":"2015-01-05T02:33:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/18335","html_url":"https://github.com/rails/rails/pull/18335","diff_url":"https://github.com/rails/rails/pull/18335.diff","patch_url":"https://github.com/rails/rails/pull/18335.patch"},"body":"Per @dhh's request in #18330:\r\n\r\n* `#weekend?` returns true if the receiving date/time falls on a Saturday or Sunday.\r\n* `#next_weekday` returns a new date/time representing the next day that does not fall on a Saturday or Sunday.\r\n* `#prev_weekday` returns a new date/time representing the previous day that does not fall on a Saturday or Sunday.\r\n\r\nRails already provides `#yesterday` and `#tomorrow` for dates and times, so I didn't bother implementing `#prev_day` or `#next_day`."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/68661908","html_url":"https://github.com/rails/rails/pull/18335#issuecomment-68661908","issue_url":"https://api.github.com/repos/rails/rails/issues/18335","id":68661908,"user":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T02:33:37Z","updated_at":"2015-01-05T02:33:37Z","body":"@georgeclaghorn, I'd actually prefer to have them use advance(days: 1) and advance(days: -1). yesterday/tomorrow are just not clear for this purpose. Even if the result is the same, the code is a lot less clear.\r\n\r\nI'd like same_time on `prev_week`, but I don't think it makes sense on beginning_of_week and end_of_week. Those are referring to a specific moment in time."}}