From 791c0d345fcf146b841c53ec9c00b22607061843 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 5 Jan 2024 20:17:24 +0100 Subject: [PATCH] Make periodPrediction on Calendar adjustable --- components/helpers/calendar.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/helpers/calendar.js b/components/helpers/calendar.js index e929255..4468115 100644 --- a/components/helpers/calendar.js +++ b/components/helpers/calendar.js @@ -2,6 +2,7 @@ import { LocalDate } from '@js-joda/core' import { verticalScale } from 'react-native-size-matters' import { Colors, Fonts, Sizes } from '../../styles' +import { periodPredictionObservable } from '../../local-storage' const { shades } = Colors.iconColors.bleeding @@ -26,6 +27,7 @@ export const toCalFormat = (bleedingDaysSortedByDate) => { } export const predictionToCalFormat = (predictedDays) => { + if (!periodPredictionObservable.value) return {} if (!predictedDays.length) return {} const todayDateString = LocalDate.now().toString() const middleIndex = (predictedDays[0].length - 1) / 2