506: Enable custom timing for period reminders

Users can now specify how many days prior to their next predicted period they want to be notified
This commit is contained in:
Hannelore Meier
2024-08-29 16:24:34 +02:00
parent 805587302b
commit dddb095463
9 changed files with 229 additions and 88 deletions
+7 -4
View File
@@ -60,10 +60,13 @@ export default {
},
periodReminder: {
title: 'Next period reminder',
reminderText:
'Get a notification 3 days before your next period is likely to start.',
notification: (daysToEndOfPrediction) =>
`Your next period is likely to start in 3 to ${daysToEndOfPrediction} days.`,
reminderText: (days) => {
const dayCount = parseInt(days, 10)
const dayText = dayCount === 1 ? '1 day' : `${dayCount} days`
return `Get a notification ${dayText} before your next period is likely to start.`
},
notification: (advanceNoticeDays, daysToEndOfPrediction) =>
`Your next period is likely to start in ${advanceNoticeDays} to ${daysToEndOfPrediction} days.`,
alertNoPeriodReminder: {
title: 'Period predictions turned off',
message: