Skip to content
Snippets Groups Projects
Commit 107688ac authored by tina's avatar tina
Browse files

checks whether reminder date is already passed

parent 7f680296
No related branches found
No related tags found
No related merge requests found
...@@ -64,14 +64,17 @@ function setupPeriodReminder() { ...@@ -64,14 +64,17 @@ function setupPeriodReminder() {
.hours(6) .hours(6)
.minutes(0) .minutes(0)
.seconds(0) .seconds(0)
if (reminderDate.isAfter()) {
// period is likely to start in 3 to 3 + (length of prediction - 1) days // period is likely to start in 3 to 3 + (length of prediction - 1) days
const daysToEndOfPrediction = bleedingPrediction[0].length + 2 const daysToEndOfPrediction = bleedingPrediction[0].length + 2
Notification.localNotificationSchedule({ Notification.localNotificationSchedule({
id: '2', id: '2',
message: labels.periodReminder.notification(daysToEndOfPrediction), message: labels.periodReminder.notification(daysToEndOfPrediction),
date: reminderDate.toDate(), date: reminderDate.toDate(),
vibrate: false vibrate: false
}) })
}
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment