{"action":"created","comment":{"url":"https://api.github.com/repos/wix/react-native-calendars/pulls/comments/360803745","pull_request_review_id":335756178,"id":360803745,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2MDgwMzc0NQ==","diff_hunk":"@@ -57,62 +61,133 @@ class WeekCalendar extends Component {\n       dayOfTheWeek = 7 + dayOfTheWeek;\n     }\n     // leave the current date in the visible week as is\n-    const dd = index === 0 ? d : d.addDays(firstDay - dayOfTheWeek);\n-    const newDate = dd.addWeeks(index);\n+    const dd = weekIndex === 0 ? d : d.addDays(firstDay - dayOfTheWeek);\n+    const newDate = dd.addWeeks(weekIndex);\n     const dateString = newDate.toString('yyyy-MM-dd');\n     return dateString;\n   }\n \n-  onViewableItemsChanged = ({viewableItems}) => {\n-    // NOTE: gets called only on week scroll (so might be un-synced with displayed week) !!!\n-    if (viewableItems.length > 0) {\n-      const viweableItem = _.first(viewableItems);\n-      if (viweableItem.isViewable && this.visibleItem !== viweableItem.item) {\n-        if (this.visibleItem) { // to avoid invoke on first init\n-          _.invoke(this.props.context, 'setDate', viweableItem.item, UPDATE_SOURCES.WEEK_SCROLL); \n+  onScroll = ({\n+    nativeEvent: {\n+      contentOffset: {x},\n+    },\n+  }) => {\n+    const newPage = Math.round(x / commons.screenWidth);\n+    if (this.page !== newPage) {\n+      const {items} = this.state;\n+      this.page = newPage;\n+\n+      _.invoke(\n+        this.props.context,\n+        'setDate',\n+        items[this.page],\n+        UPDATE_SOURCES.WEEK_SCROLL,\n+      );\n+\n+      if (this.page === items.length - 1) {\n+        for (let i = 0; i <= NUMBER_OF_PAGES; i++) {\n+          items[i] = items[i + NUMBER_OF_PAGES];\n+        }\n+        this.setState({items: [...items]});\n+      } else if (this.page === 0) {\n+\n+        for (let i = NUMBER_OF_PAGES; i < items.length; i++) {\n+          items[i] = items[i - NUMBER_OF_PAGES];\n         }\n-        this.visibleItem = viweableItem.item;\n+\n+        this.setState({items: [...items]});\n       }\n     }\n-  }\n+  };\n+\n+  onMomentumScrollEnd = () => {\n+    const {items} = this.state;\n+    const isFirstPage = this.page === 0;\n+    const isLastPage = this.page === items.length - 1;\n+\n+    if (isFirstPage || isLastPage) {\n+      this.list.current.scrollToIndex({\n+        animated: false,\n+        index: NUMBER_OF_PAGES,\n+      });\n+      this.page = NUMBER_OF_PAGES;\n+      const newWeekArray = this.getDatesArray();\n+\n+      if (isLastPage) {\n+","path":"src/expandableCalendar/weekCalendar.js","position":130,"original_position":130,"commit_id":"dfc584a41cad63a07a91d8dcd0445acac5ffc473","original_commit_id":"dfc584a41cad63a07a91d8dcd0445acac5ffc473","user":{"login":"Inbal-Tish","id":33805983,"node_id":"MDQ6VXNlcjMzODA1OTgz","avatar_url":"https://avatars3.githubusercontent.com/u/33805983?v=4","gravatar_id":"","url":"https://api.github.com/users/Inbal-Tish","html_url":"https://github.com/Inbal-Tish","followers_url":"https://api.github.com/users/Inbal-Tish/followers","following_url":"https://api.github.com/users/Inbal-Tish/following{/other_user}","gists_url":"https://api.github.com/users/Inbal-Tish/gists{/gist_id}","starred_url":"https://api.github.com/users/Inbal-Tish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inbal-Tish/subscriptions","organizations_url":"https://api.github.com/users/Inbal-Tish/orgs","repos_url":"https://api.github.com/users/Inbal-Tish/repos","events_url":"https://api.github.com/users/Inbal-Tish/events{/privacy}","received_events_url":"https://api.github.com/users/Inbal-Tish/received_events","type":"User","site_admin":false},"body":"Unnecessary empty line","created_at":"2019-12-23T08:25:18Z","updated_at":"2019-12-23T08:25:18Z","html_url":"https://github.com/wix/react-native-calendars/pull/1015#discussion_r360803745","pull_request_url":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/comments/360803745"},"html":{"href":"https://github.com/wix/react-native-calendars/pull/1015#discussion_r360803745"},"pull_request":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015"}}},"pull_request":{"url":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015","id":356103072,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU2MTAzMDcy","html_url":"https://github.com/wix/react-native-calendars/pull/1015","diff_url":"https://github.com/wix/react-native-calendars/pull/1015.diff","patch_url":"https://github.com/wix/react-native-calendars/pull/1015.patch","issue_url":"https://api.github.com/repos/wix/react-native-calendars/issues/1015","number":1015,"state":"open","locked":false,"title":"Feat/expandable week scroll android fix","user":{"login":"ethanshar","id":1780255,"node_id":"MDQ6VXNlcjE3ODAyNTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1780255?v=4","gravatar_id":"","url":"https://api.github.com/users/ethanshar","html_url":"https://github.com/ethanshar","followers_url":"https://api.github.com/users/ethanshar/followers","following_url":"https://api.github.com/users/ethanshar/following{/other_user}","gists_url":"https://api.github.com/users/ethanshar/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanshar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanshar/subscriptions","organizations_url":"https://api.github.com/users/ethanshar/orgs","repos_url":"https://api.github.com/users/ethanshar/repos","events_url":"https://api.github.com/users/ethanshar/events{/privacy}","received_events_url":"https://api.github.com/users/ethanshar/received_events","type":"User","site_admin":false},"body":"I added the fix. please take a look.\r\n \r\nIn general there's still a very minor issue in both platforms, when u scroll really fast you might get stuck because the FlatList didn't got a chance to scroll back to the middle.\r\n(on Android it's a little more noticeable) \r\n\r\nAnother issue I noticed, not sure if it was there before, when I scroll a week, the first day doesn't always get marked. (only the edge pages). Possible I created this issue, I assume it's fixable. \r\n\r\nanyway, please go over and let me know if there're other issues, it would never be perfect on Android, just because it's Android, but at least it doesn't have the flicker. ","created_at":"2019-12-22T16:42:36Z","updated_at":"2019-12-23T08:25:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"168cc4f25bcfbbcd5ce5b637b792151efd81afa0","assignee":{"login":"Inbal-Tish","id":33805983,"node_id":"MDQ6VXNlcjMzODA1OTgz","avatar_url":"https://avatars3.githubusercontent.com/u/33805983?v=4","gravatar_id":"","url":"https://api.github.com/users/Inbal-Tish","html_url":"https://github.com/Inbal-Tish","followers_url":"https://api.github.com/users/Inbal-Tish/followers","following_url":"https://api.github.com/users/Inbal-Tish/following{/other_user}","gists_url":"https://api.github.com/users/Inbal-Tish/gists{/gist_id}","starred_url":"https://api.github.com/users/Inbal-Tish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inbal-Tish/subscriptions","organizations_url":"https://api.github.com/users/Inbal-Tish/orgs","repos_url":"https://api.github.com/users/Inbal-Tish/repos","events_url":"https://api.github.com/users/Inbal-Tish/events{/privacy}","received_events_url":"https://api.github.com/users/Inbal-Tish/received_events","type":"User","site_admin":false},"assignees":[{"login":"Inbal-Tish","id":33805983,"node_id":"MDQ6VXNlcjMzODA1OTgz","avatar_url":"https://avatars3.githubusercontent.com/u/33805983?v=4","gravatar_id":"","url":"https://api.github.com/users/Inbal-Tish","html_url":"https://github.com/Inbal-Tish","followers_url":"https://api.github.com/users/Inbal-Tish/followers","following_url":"https://api.github.com/users/Inbal-Tish/following{/other_user}","gists_url":"https://api.github.com/users/Inbal-Tish/gists{/gist_id}","starred_url":"https://api.github.com/users/Inbal-Tish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inbal-Tish/subscriptions","organizations_url":"https://api.github.com/users/Inbal-Tish/orgs","repos_url":"https://api.github.com/users/Inbal-Tish/repos","events_url":"https://api.github.com/users/Inbal-Tish/events{/privacy}","received_events_url":"https://api.github.com/users/Inbal-Tish/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015/commits","review_comments_url":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015/comments","review_comment_url":"https://api.github.com/repos/wix/react-native-calendars/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wix/react-native-calendars/issues/1015/comments","statuses_url":"https://api.github.com/repos/wix/react-native-calendars/statuses/dfc584a41cad63a07a91d8dcd0445acac5ffc473","head":{"label":"wix:feat/Expandable_week_scroll_android_fix","ref":"feat/Expandable_week_scroll_android_fix","sha":"dfc584a41cad63a07a91d8dcd0445acac5ffc473","user":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"repo":{"id":73475252,"node_id":"MDEwOlJlcG9zaXRvcnk3MzQ3NTI1Mg==","name":"react-native-calendars","full_name":"wix/react-native-calendars","private":false,"owner":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wix/react-native-calendars","description":"React Native Calendar Components 📆 ","fork":false,"url":"https://api.github.com/repos/wix/react-native-calendars","forks_url":"https://api.github.com/repos/wix/react-native-calendars/forks","keys_url":"https://api.github.com/repos/wix/react-native-calendars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wix/react-native-calendars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wix/react-native-calendars/teams","hooks_url":"https://api.github.com/repos/wix/react-native-calendars/hooks","issue_events_url":"https://api.github.com/repos/wix/react-native-calendars/issues/events{/number}","events_url":"https://api.github.com/repos/wix/react-native-calendars/events","assignees_url":"https://api.github.com/repos/wix/react-native-calendars/assignees{/user}","branches_url":"https://api.github.com/repos/wix/react-native-calendars/branches{/branch}","tags_url":"https://api.github.com/repos/wix/react-native-calendars/tags","blobs_url":"https://api.github.com/repos/wix/react-native-calendars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wix/react-native-calendars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wix/react-native-calendars/git/refs{/sha}","trees_url":"https://api.github.com/repos/wix/react-native-calendars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wix/react-native-calendars/statuses/{sha}","languages_url":"https://api.github.com/repos/wix/react-native-calendars/languages","stargazers_url":"https://api.github.com/repos/wix/react-native-calendars/stargazers","contributors_url":"https://api.github.com/repos/wix/react-native-calendars/contributors","subscribers_url":"https://api.github.com/repos/wix/react-native-calendars/subscribers","subscription_url":"https://api.github.com/repos/wix/react-native-calendars/subscription","commits_url":"https://api.github.com/repos/wix/react-native-calendars/commits{/sha}","git_commits_url":"https://api.github.com/repos/wix/react-native-calendars/git/commits{/sha}","comments_url":"https://api.github.com/repos/wix/react-native-calendars/comments{/number}","issue_comment_url":"https://api.github.com/repos/wix/react-native-calendars/issues/comments{/number}","contents_url":"https://api.github.com/repos/wix/react-native-calendars/contents/{+path}","compare_url":"https://api.github.com/repos/wix/react-native-calendars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wix/react-native-calendars/merges","archive_url":"https://api.github.com/repos/wix/react-native-calendars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wix/react-native-calendars/downloads","issues_url":"https://api.github.com/repos/wix/react-native-calendars/issues{/number}","pulls_url":"https://api.github.com/repos/wix/react-native-calendars/pulls{/number}","milestones_url":"https://api.github.com/repos/wix/react-native-calendars/milestones{/number}","notifications_url":"https://api.github.com/repos/wix/react-native-calendars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wix/react-native-calendars/labels{/name}","releases_url":"https://api.github.com/repos/wix/react-native-calendars/releases{/id}","deployments_url":"https://api.github.com/repos/wix/react-native-calendars/deployments","created_at":"2016-11-11T12:17:27Z","updated_at":"2019-12-23T03:17:54Z","pushed_at":"2019-12-22T16:42:36Z","git_url":"git://github.com/wix/react-native-calendars.git","ssh_url":"git@github.com:wix/react-native-calendars.git","clone_url":"https://github.com/wix/react-native-calendars.git","svn_url":"https://github.com/wix/react-native-calendars","homepage":"","size":4796,"stargazers_count":5012,"watchers_count":5012,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1475,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":435,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1475,"open_issues":435,"watchers":5012,"default_branch":"master"}},"base":{"label":"wix:feat/Expandable_week_scroll","ref":"feat/Expandable_week_scroll","sha":"c30cb9c2fa6f683a6f800805f513ef13d62065cb","user":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"repo":{"id":73475252,"node_id":"MDEwOlJlcG9zaXRvcnk3MzQ3NTI1Mg==","name":"react-native-calendars","full_name":"wix/react-native-calendars","private":false,"owner":{"login":"wix","id":686511,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/686511?v=4","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wix/react-native-calendars","description":"React Native Calendar Components 📆 ","fork":false,"url":"https://api.github.com/repos/wix/react-native-calendars","forks_url":"https://api.github.com/repos/wix/react-native-calendars/forks","keys_url":"https://api.github.com/repos/wix/react-native-calendars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wix/react-native-calendars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wix/react-native-calendars/teams","hooks_url":"https://api.github.com/repos/wix/react-native-calendars/hooks","issue_events_url":"https://api.github.com/repos/wix/react-native-calendars/issues/events{/number}","events_url":"https://api.github.com/repos/wix/react-native-calendars/events","assignees_url":"https://api.github.com/repos/wix/react-native-calendars/assignees{/user}","branches_url":"https://api.github.com/repos/wix/react-native-calendars/branches{/branch}","tags_url":"https://api.github.com/repos/wix/react-native-calendars/tags","blobs_url":"https://api.github.com/repos/wix/react-native-calendars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wix/react-native-calendars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wix/react-native-calendars/git/refs{/sha}","trees_url":"https://api.github.com/repos/wix/react-native-calendars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wix/react-native-calendars/statuses/{sha}","languages_url":"https://api.github.com/repos/wix/react-native-calendars/languages","stargazers_url":"https://api.github.com/repos/wix/react-native-calendars/stargazers","contributors_url":"https://api.github.com/repos/wix/react-native-calendars/contributors","subscribers_url":"https://api.github.com/repos/wix/react-native-calendars/subscribers","subscription_url":"https://api.github.com/repos/wix/react-native-calendars/subscription","commits_url":"https://api.github.com/repos/wix/react-native-calendars/commits{/sha}","git_commits_url":"https://api.github.com/repos/wix/react-native-calendars/git/commits{/sha}","comments_url":"https://api.github.com/repos/wix/react-native-calendars/comments{/number}","issue_comment_url":"https://api.github.com/repos/wix/react-native-calendars/issues/comments{/number}","contents_url":"https://api.github.com/repos/wix/react-native-calendars/contents/{+path}","compare_url":"https://api.github.com/repos/wix/react-native-calendars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wix/react-native-calendars/merges","archive_url":"https://api.github.com/repos/wix/react-native-calendars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wix/react-native-calendars/downloads","issues_url":"https://api.github.com/repos/wix/react-native-calendars/issues{/number}","pulls_url":"https://api.github.com/repos/wix/react-native-calendars/pulls{/number}","milestones_url":"https://api.github.com/repos/wix/react-native-calendars/milestones{/number}","notifications_url":"https://api.github.com/repos/wix/react-native-calendars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wix/react-native-calendars/labels{/name}","releases_url":"https://api.github.com/repos/wix/react-native-calendars/releases{/id}","deployments_url":"https://api.github.com/repos/wix/react-native-calendars/deployments","created_at":"2016-11-11T12:17:27Z","updated_at":"2019-12-23T03:17:54Z","pushed_at":"2019-12-22T16:42:36Z","git_url":"git://github.com/wix/react-native-calendars.git","ssh_url":"git@github.com:wix/react-native-calendars.git","clone_url":"https://github.com/wix/react-native-calendars.git","svn_url":"https://github.com/wix/react-native-calendars","homepage":"","size":4796,"stargazers_count":5012,"watchers_count":5012,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1475,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":435,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1475,"open_issues":435,"watchers":5012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015"},"html":{"href":"https://github.com/wix/react-native-calendars/pull/1015"},"issue":{"href":"https://api.github.com/repos/wix/react-native-calendars/issues/1015"},"comments":{"href":"https://api.github.com/repos/wix/react-native-calendars/issues/1015/comments"},"review_comments":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015/comments"},"review_comment":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wix/react-native-calendars/pulls/1015/commits"},"statuses":{"href":"https://api.github.com/repos/wix/react-native-calendars/statuses/dfc584a41cad63a07a91d8dcd0445acac5ffc473"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Inbal-Tish"}}