{"action":"created","issue":{"url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/1767","repository_url":"https://api.github.com/repos/rackerlabs/encore-ui","labels_url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/1767/labels{/name}","comments_url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/1767/comments","events_url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/1767/events","html_url":"https://github.com/rackerlabs/encore-ui/issues/1767","id":170768142,"number":1767,"title":"rxAge filter doesn't handle very small time differences properly.","user":{"login":"jj4th","id":1107895,"avatar_url":"https://avatars.githubusercontent.com/u/1107895?v=3","gravatar_id":"","url":"https://api.github.com/users/jj4th","html_url":"https://github.com/jj4th","followers_url":"https://api.github.com/users/jj4th/followers","following_url":"https://api.github.com/users/jj4th/following{/other_user}","gists_url":"https://api.github.com/users/jj4th/gists{/gist_id}","starred_url":"https://api.github.com/users/jj4th/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jj4th/subscriptions","organizations_url":"https://api.github.com/users/jj4th/orgs","repos_url":"https://api.github.com/users/jj4th/repos","events_url":"https://api.github.com/users/jj4th/events{/privacy}","received_events_url":"https://api.github.com/users/jj4th/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-11T23:11:12Z","updated_at":"2016-08-11T23:12:21Z","closed_at":null,"body":"**Observed with:**\r\n`Encore UI: 1.45.0` + `Moment: 2.5.1` AND\r\n`Encore-UI: master` + `Moment: 1.13.0`\r\n\r\n**Steps to recreate:**\r\n- Invoke rxAge filter with `new Date();` or a date within a few milliseconds of the current date.\r\n\r\n**Result:**\r\nrxAge returns an improper date, typically `1 minute, -22 hours`\r\n\r\nThis happens because of the behavior of the line: https://github.com/rackerlabs/encore-ui/blob/master/src/utilities/rxAge/scripts/rxAge.js#L76\r\n\r\n```javascript\r\nvar days = parseInt(duration.asDays(), 10);\r\n```\r\n\r\nHere is the example node console output using very small duration values with the current version of moment to demonstrate the behavior that causes this error:\r\n![screen shot 2016-08-11 at 6 05 34 pm](https://cloud.githubusercontent.com/assets/1107895/17607977/fba83a22-5fee-11e6-8ca9-6ede1b116bb1.png)\r\n"},"comment":{"url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/comments/239321079","html_url":"https://github.com/rackerlabs/encore-ui/issues/1767#issuecomment-239321079","issue_url":"https://api.github.com/repos/rackerlabs/encore-ui/issues/1767","id":239321079,"user":{"login":"jj4th","id":1107895,"avatar_url":"https://avatars.githubusercontent.com/u/1107895?v=3","gravatar_id":"","url":"https://api.github.com/users/jj4th","html_url":"https://github.com/jj4th","followers_url":"https://api.github.com/users/jj4th/followers","following_url":"https://api.github.com/users/jj4th/following{/other_user}","gists_url":"https://api.github.com/users/jj4th/gists{/gist_id}","starred_url":"https://api.github.com/users/jj4th/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jj4th/subscriptions","organizations_url":"https://api.github.com/users/jj4th/orgs","repos_url":"https://api.github.com/users/jj4th/repos","events_url":"https://api.github.com/users/jj4th/events{/privacy}","received_events_url":"https://api.github.com/users/jj4th/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T23:12:21Z","updated_at":"2016-08-11T23:12:21Z","body":"It is worth noting that `moment.duration` generates a float, not a string, so `parseInt` is probably wrong here."}}
{"actor":{"display_login":"jj4th"}}