{"action":"closed","issue":{"url":"https://api.github.com/repos/moment/moment/issues/2999","repository_url":"https://api.github.com/repos/moment/moment","labels_url":"https://api.github.com/repos/moment/moment/issues/2999/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/2999/comments","events_url":"https://api.github.com/repos/moment/moment/issues/2999/events","html_url":"https://github.com/moment/moment/issues/2999","id":138344644,"number":2999,"title":"Moment.day() goes backwards instead of forwards!","user":{"login":"joshribakoff","id":4021306,"avatar_url":"https://avatars.githubusercontent.com/u/4021306?v=3","gravatar_id":"","url":"https://api.github.com/users/joshribakoff","html_url":"https://github.com/joshribakoff","followers_url":"https://api.github.com/users/joshribakoff/followers","following_url":"https://api.github.com/users/joshribakoff/following{/other_user}","gists_url":"https://api.github.com/users/joshribakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/joshribakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshribakoff/subscriptions","organizations_url":"https://api.github.com/users/joshribakoff/orgs","repos_url":"https://api.github.com/users/joshribakoff/repos","events_url":"https://api.github.com/users/joshribakoff/events{/privacy}","received_events_url":"https://api.github.com/users/joshribakoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-04T01:06:33Z","updated_at":"2016-03-04T22:38:08Z","closed_at":"2016-03-04T22:38:08Z","body":"Here's the documentation I see:\r\n![selection_304](https://cloud.githubusercontent.com/assets/4021306/13514927/df4528ce-e161-11e5-82b4-a4805b7e6278.png)\r\n\r\nIf I ask what is the \"Next monday\" from August 1st 2015, I expect it to go forwards & give me 08-03-2015 which is the first Monday *after* the given date. Instead, it went backwards to \"last monday\" even though I passed in a *positive* integer for \"next monday\"....\r\n```js\r\nmoment('2015-8-01', 'YYYY-MM-DD').day(1).format('YYYY-MM-DD')\r\n// gives \"2015-07-27\"\r\n// I expect \"2015-08-03\"\r\n```\r\n\r\nIf I tell it to give me \"last Monday\", its returning a date that isn't even a Monday. I'd expect to get 2015-07-27\r\n```js\r\nmoment('2015-8-01', 'YYYY-MM-DD').day(-1).format('YYYY-MM-DD')\r\n// Gives \"2015-07-25\"\r\n// Expected \"2015-07-27\"\r\n```\r\n\r\nSince Moment isn't working as I expected, I've written the logic myself, here's how I expect it to behave:\r\n```js\r\nwhile(myMoment.format('dddd') != 'Monday') {\r\n myMoment.add(1, 'days');\r\n}\r\n```"}}