checks whether reminder date is already passed
This commit is contained in:
+11
-8
@@ -64,14 +64,17 @@ function setupPeriodReminder() {
|
||||
.hours(6)
|
||||
.minutes(0)
|
||||
.seconds(0)
|
||||
// period is likely to start in 3 to 3 + (length of prediction - 1) days
|
||||
const daysToEndOfPrediction = bleedingPrediction[0].length + 2
|
||||
|
||||
Notification.localNotificationSchedule({
|
||||
id: '2',
|
||||
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
||||
date: reminderDate.toDate(),
|
||||
vibrate: false
|
||||
})
|
||||
if (reminderDate.isAfter()) {
|
||||
// period is likely to start in 3 to 3 + (length of prediction - 1) days
|
||||
const daysToEndOfPrediction = bleedingPrediction[0].length + 2
|
||||
|
||||
Notification.localNotificationSchedule({
|
||||
id: '2',
|
||||
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
||||
date: reminderDate.toDate(),
|
||||
vibrate: false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user