From baa057229e1d69862327c0c51cb7a2d53efc6cda Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 5 Apr 2024 12:50:22 +0200 Subject: [PATCH] Fix: Bug for displayedMonth of oldest scrollable date on chart --- components/chart/chart.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index 47757d4..350f584 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -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 }) => {