fix age to start at 0 on start date of cycle instead of 1

This commit is contained in:
Alberto-Audrix committed 2026-09-02 09:58:59 +07:00
1 parent 3411ed4391
commit 54eb277c16
7 files changed
+33 -10

No files matched your search

@@ -75,8 +75,7 @@ const ReportPreviewOverlay: React.FC<Props> = ({ open, reportType, onClose }) =>
const [error, setError] = useState<string | null>(null);
const printRef = useRef<HTMLDivElement>(null);
// cycle.current_day is 1-based (day 1 = start_date); report days are 0-based.
const latestDay = selectedCycle ? Math.max(0, selectedCycle.current_day - 1) : 0;
const latestDay = selectedCycle ? Math.max(0, selectedCycle.current_day) : 0;
const endCycleDay = selectedCycle
? Math.min(
selectedCycle.total_days,