Fix: Bug for displayedMonth of oldest scrollable date on chart

This commit is contained in:
bl00dymarie
2024-04-05 12:50:22 +02:00
parent a54e48b17e
commit baa057229e
+5 -1
View File
@@ -136,8 +136,12 @@ const CycleChart = ({ navigate, setDate }) => {
const getcomputedDateInView = () => {
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
return columns[columnIndex + numberOfColumnsToRender]
return columns[leftIndex]
}
const renderColumn = ({ item }) => {