Skip to content

Commit

Permalink
updated isBetween function to work better
Browse files Browse the repository at this point in the history
  • Loading branch information
Mudiwa Matanda authored and Mudiwa Matanda committed Oct 28, 2024
1 parent 2006104 commit d76a047
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ussd_clinic_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ go.app = function() {
"Enter the day that baby was born as a number. For example if baby was born on 12th May, type in 12"
].join("\n"));
}
if (!date.isBetween(current_date.clone().add(-2, "years")) && (!date.isSame(current_date, date)) ) {
if (!date.isBetween(current_date.clone().add(-2, "years"), current_date.add(1, "days")) ) {
return $(
"Unfortunately MomConnect doesn't send messages to children older " +
"than 2 years. Please try again by entering the day the baby was " +
Expand Down

0 comments on commit d76a047

Please sign in to comment.