{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2345","labels_url":"https://api.github.com/repos/moment/moment/issues/2345/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2345/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2345/events","html_url":"https://github.com/moment/moment/issues/2345","id":71010702,"number":2345,"title":"moment().utcOffet(-5 * 60).day(5) resulting in *last* Friday","user":{"login":"Panoplos","id":2549985,"avatar_url":"https://avatars.githubusercontent.com/u/2549985?v=3","gravatar_id":"","url":"https://api.github.com/users/Panoplos","html_url":"https://github.com/Panoplos","followers_url":"https://api.github.com/users/Panoplos/followers","following_url":"https://api.github.com/users/Panoplos/following{/other_user}","gists_url":"https://api.github.com/users/Panoplos/gists{/gist_id}","starred_url":"https://api.github.com/users/Panoplos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Panoplos/subscriptions","organizations_url":"https://api.github.com/users/Panoplos/orgs","repos_url":"https://api.github.com/users/Panoplos/repos","events_url":"https://api.github.com/users/Panoplos/events{/privacy}","received_events_url":"https://api.github.com/users/Panoplos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-26T04:53:38Z","updated_at":"2015-05-02T01:25:38Z","closed_at":"2015-05-02T01:25:38Z","body":"I have the following code:\r\n\r\n```js\r\nd = moment() // -> '2015-04-26T13:46:22+09:00' (this is a Sunday (JST))\r\nd.utcOffet(-5 * 60) // -> '2015-04-25T23:46:22-05:00' (this is a Saturday (EST))\r\nd.day() // -> 6 (as I said, Saturday)\r\nd.day(5) // -> '2015-04-24T23:46:22-05:00' (this is *last* Friday)\r\n```\r\n\r\nI thought `moment().day(5)` was supposed to set the date to _*next*_ Friday. If this is the case, then the above is exhibiting a bug.\r\n\r\nIf not, what is the correct way to go about this?\r\n\r\nCheers in advance!"},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/98277094","html_url":"https://github.com/moment/moment/issues/2345#issuecomment-98277094","issue_url":"https://api.github.com/repos/moment/moment/issues/2345","id":98277094,"user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T01:25:38Z","updated_at":"2015-05-02T01:25:38Z","body":"@Pumpuli is right: it takes you to the Friday of your current week, which you changed to last week. If you know you're in the previous week (or you find out that you are by comparing `week()`), then you can just use `d.day(5 + 7)`"}}