Fix: Bug for displayedMonth of oldest scrollable date on chart
This commit is contained in:
@@ -136,8 +136,12 @@ const CycleChart = ({ navigate, setDate }) => {
|
|||||||
|
|
||||||
const getcomputedDateInView = () => {
|
const getcomputedDateInView = () => {
|
||||||
const columnIndex = Math.floor(currentScrollPosition / CHART_COLUMN_WIDTH)
|
const columnIndex = Math.floor(currentScrollPosition / CHART_COLUMN_WIDTH)
|
||||||
|
const leftIndex =
|
||||||
|
columnIndex + numberOfColumnsToRender >= columns.length
|
||||||
|
? 153
|
||||||
|
: columnIndex + numberOfColumnsToRender
|
||||||
// detect oldest visible day to render its month dynamically
|
// detect oldest visible day to render its month dynamically
|
||||||
return columns[columnIndex + numberOfColumnsToRender]
|
return columns[leftIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderColumn = ({ item }) => {
|
const renderColumn = ({ item }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user