Skip to content

Commit

Permalink
Merge pull request #616 from praekeltfoundation/feature-edd-update
Browse files Browse the repository at this point in the history
EDD Date Format
  • Loading branch information
DevChima authored Oct 25, 2023
2 parents 7e0f958 + d3f509f commit a288d13
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go-app-ussd_popi_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ go.app = function() {

self.add("state_active_prebirth_check", function(name){
var contact = self.im.user.answers.contact;
var edd = new moment(_.get(contact, "fields.edd", null)).format("DD-MM-YYYY");
var edd = new moment(self.dateformat(_.get(contact, "fields.edd", null))).format("DD-MM-YYYY");
var prebirth = _.inRange(_.get(contact, "fields.prebirth_messaging"), 1, 7);

if (!prebirth) {
Expand Down
2 changes: 1 addition & 1 deletion src/ussd_popi_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ go.app = function() {

self.add("state_active_prebirth_check", function(name){
var contact = self.im.user.answers.contact;
var edd = new moment(_.get(contact, "fields.edd", null)).format("DD-MM-YYYY");
var edd = new moment(self.dateformat(_.get(contact, "fields.edd", null))).format("DD-MM-YYYY");
var prebirth = _.inRange(_.get(contact, "fields.prebirth_messaging"), 1, 7);

if (!prebirth) {
Expand Down
2 changes: 1 addition & 1 deletion test/ussd_popi_rapidpro.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ describe("ussd_popi_rapidpro app", function() {
baby_dob1: "2021-03-10",
baby_dob2: "2021-11-11",
baby_dob3: "2022-03-07",
edd: "2022-06-06",
edd: "2022-06-06T00:00:00Z",
prebirth_messaging: "1"
},
})
Expand Down

0 comments on commit a288d13

Please sign in to comment.