{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/4127","repository_url":"https://api.github.com/repos/moment/moment","labels_url":"https://api.github.com/repos/moment/moment/issues/4127/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/4127/comments","events_url":"https://api.github.com/repos/moment/moment/issues/4127/events","html_url":"https://github.com/moment/moment/issues/4127","id":250878597,"number":4127,"title":"from()/to() wrong days calculation around a month","user":{"login":"pretender","id":789779,"avatar_url":"https://avatars2.githubusercontent.com/u/789779?v=4","gravatar_id":"","url":"https://api.github.com/users/pretender","html_url":"https://github.com/pretender","followers_url":"https://api.github.com/users/pretender/followers","following_url":"https://api.github.com/users/pretender/following{/other_user}","gists_url":"https://api.github.com/users/pretender/gists{/gist_id}","starred_url":"https://api.github.com/users/pretender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pretender/subscriptions","organizations_url":"https://api.github.com/users/pretender/orgs","repos_url":"https://api.github.com/users/pretender/repos","events_url":"https://api.github.com/users/pretender/events{/privacy}","received_events_url":"https://api.github.com/users/pretender/received_events","type":"User","site_admin":false},"labels":[{"id":168355,"url":"https://api.github.com/repos/moment/moment/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-17T09:14:52Z","updated_at":"2017-09-14T10:29:01Z","closed_at":null,"author_association":"NONE","body":"**Description of the Issue and Steps to Reproduce:**\r\n\r\nGot the same result for the very different dates in to()/from():\r\n```js\r\nconst moment = require('moment')\r\nvar expiredAt = moment('2017-07-16T21:01:54.249Z')\r\nvar now = moment('2017-08-16T00:02:01.249Z')\r\nvar tomorrow = moment('2017-08-17T00:02:01.249Z')\r\n\r\nnow.to(expiredAt) // 'a month ago' (expected)\r\ntomorrow.to(expiredAt) // 'a month ago' (expected)\r\n\r\nmoment.relativeTimeThreshold('d', 180)\r\nnow.to(expiredAt) // '30 days ago' (expected)\r\ntomorrow.to(expiredAt) // '30 days ago' (unexpected)\r\n```\r\nPlease, no. Maybe there are 30.00000001 and 30.99999999 values in math, let's see:\r\n```js\r\nmoment.relativeTimeRounding(v => { return v; })\r\nnow.to(expiredAt) // '30.125081018518518 days ago' (well, ok)\r\ntomorrow.to(expiredAt) // '30.125081018518518 days ago'\r\n```\r\nGod, please, no. They are the same!\r\n```js\r\nexpiredAt.format('x') // '1500238914249'\r\nnow.format('x') // '1502841721249'\r\nconsole.log((1502841721249 - 1500238914249) / 1000 / 60 / 60 / 24) // 30.125081018518518\r\n\r\ntomorrow.format('x') // '1502928121249'\r\nconsole.log((1502928121249 - 1500238914249) / 1000 / 60 / 60 / 24) // 31.125081018518518\r\n```\r\n\r\n**Environment:**\r\n\r\nDebian 8.7, Node.JS v4.4.7, Moment.JS v2.15.2, TZ='America/New_York'\r\nDebian 8.8, Node.JS v6.9.2, Moment.JS v2.18.1, TZ='Europe/Berlin'\r\n"},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/329441495","html_url":"https://github.com/moment/moment/issues/4127#issuecomment-329441495","issue_url":"https://api.github.com/repos/moment/moment/issues/4127","id":329441495,"user":{"login":"icambron","id":244988,"avatar_url":"https://avatars3.githubusercontent.com/u/244988?v=4","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":"2017-09-14T10:29:01Z","updated_at":"2017-09-14T10:29:01Z","author_association":"MEMBER","body":"Looks like a bug to me. PR requested"}}
{"actor":{"display_login":"icambron"}}