{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8462","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8462/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8462/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8462/events","html_url":"https://github.com/Automattic/wp-calypso/pull/8462","id":181008949,"number":8462,"title":"Using UTC rather than local time to determine whether or not first-vi…","user":{"login":"spentay","id":4335450,"avatar_url":"https://avatars.githubusercontent.com/u/4335450?v=3","gravatar_id":"","url":"https://api.github.com/users/spentay","html_url":"https://github.com/spentay","followers_url":"https://api.github.com/users/spentay/followers","following_url":"https://api.github.com/users/spentay/following{/other_user}","gists_url":"https://api.github.com/users/spentay/gists{/gist_id}","starred_url":"https://api.github.com/users/spentay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spentay/subscriptions","organizations_url":"https://api.github.com/users/spentay/orgs","repos_url":"https://api.github.com/users/spentay/repos","events_url":"https://api.github.com/users/spentay/events{/privacy}","received_events_url":"https://api.github.com/users/spentay/received_events","type":"User","site_admin":false},"labels":[{"id":301697869,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/OSS%20Citizen","name":"OSS Citizen","color":"5319e7","default":false},{"id":285010019,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Author%20Reply","name":"[Status] Needs Author Reply","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false},"assignees":[{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-10-04T21:24:56Z","updated_at":"2016-11-06T02:53:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8462","html_url":"https://github.com/Automattic/wp-calypso/pull/8462","diff_url":"https://github.com/Automattic/wp-calypso/pull/8462.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/8462.patch"},"body":"Hi All!\n\nI'm running unit tests here in Aus and finding that certain tests fail due to my timezone.\nInvestigating these tests have led to finding a couple of potential bugs.\n### Issue\n\nThe issues arise when a date has a specific time that is 14:00 or later.\nThis is because Australian Eastern TZ is 10 hours ahead of UTC and when the time difference is accounted for making 14:00 becomes 24:00, thus the next day.\n### Reproducing Functionality\n\nI've not been able to see the issue in the flesh, it seems difficult to reproduce!\nI'll try again to reproduce the behaviour this evening but, logically, I see this having a similar effect as my previous PR, whereby the user would be able to change the time zone and change the behaviour (as 'first-view/selectors:isUserEligible' could be true or false at the same 'time', depending on the set local time).\n\nI'm hoping somebody who knows more about the 'first-view' could take a look in the mean-time, but no worries if not.\n### Reproducing Failing Tests.\n\nManually set your timezone to be far in to the Western hemisphere (choosing Eastern Australia would be a exact match).\n\nrun client tests (npm run test-client)\n\nNote that some tests now fail including a test for 'isUserEligible' in 'first-view/selectors/'\n### Solution\n\nTo fix this I've updated the the line where moment.js is used to compare the users start date with the config start date to compare with UTC.\nThis fixes the tests and, possibly, the functionality.\n\nNotes:\n\nThere may still be 2 tests failing after applying this PR as this only fixes 1 out of 3.\nI have a PR for the other 2 @  #8458 \n"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/258657055","html_url":"https://github.com/Automattic/wp-calypso/pull/8462#issuecomment-258657055","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8462","id":258657055,"user":{"login":"dmsnell","id":5431237,"avatar_url":"https://avatars.githubusercontent.com/u/5431237?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsnell","html_url":"https://github.com/dmsnell","followers_url":"https://api.github.com/users/dmsnell/followers","following_url":"https://api.github.com/users/dmsnell/following{/other_user}","gists_url":"https://api.github.com/users/dmsnell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsnell/subscriptions","organizations_url":"https://api.github.com/users/dmsnell/orgs","repos_url":"https://api.github.com/users/dmsnell/repos","events_url":"https://api.github.com/users/dmsnell/events{/privacy}","received_events_url":"https://api.github.com/users/dmsnell/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T02:53:12Z","updated_at":"2016-11-06T02:53:12Z","body":"> It'd be really awesome if there was a clean, efficient way to do this with all time related tests, some sort of test utility that ran a test that was defined once but covering there TZ extremes...\r\n\r\na good thing to pause on and consider…"}}
{"actor":{"display_login":"dmsnell"}}