From 45550778c03b3a550b169bac24a57fdbad103405 Mon Sep 17 00:00:00 2001 From: devchima Date: Mon, 16 Oct 2023 10:39:31 -0400 Subject: [PATCH] Update edd and dob date format to dd-mm-yyyy --- go-app-ussd_popi_rapidpro.js | 4 ++-- src/ussd_popi_rapidpro.js | 4 ++-- test/ussd_popi_rapidpro.test.js | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go-app-ussd_popi_rapidpro.js b/go-app-ussd_popi_rapidpro.js index 2c831554..b3839db6 100644 --- a/go-app-ussd_popi_rapidpro.js +++ b/go-app-ussd_popi_rapidpro.js @@ -449,7 +449,7 @@ go.app = function() { new moment(_.get(contact, "fields.baby_dob1", null)), new moment(_.get(contact, "fields.baby_dob2", null)), new moment(_.get(contact, "fields.baby_dob3", null)), - ], _.method("isValid")), _.method("format", "YY-MM-DD")).join(", ") || $("None") + ], _.method("isValid")), _.method("format", "DD-MM-YYYY")).join(", ") || $("None") }; var dates_entry = Object.values(context); var sms_choices = [ @@ -520,7 +520,7 @@ go.app = function() { accept_labels: true, options_per_page: null, characters_per_page: 160, - error: $("Sorry we don't understand. Please try again."), + error: $("Sorry we don't understand. Pls try again."), choices: channel == "WhatsApp" ? whatsapp_choices : sms_choices, more: $("Next"), back: $("Previous"), diff --git a/src/ussd_popi_rapidpro.js b/src/ussd_popi_rapidpro.js index 289eed4a..336f8a3f 100644 --- a/src/ussd_popi_rapidpro.js +++ b/src/ussd_popi_rapidpro.js @@ -289,7 +289,7 @@ go.app = function() { new moment(_.get(contact, "fields.baby_dob1", null)), new moment(_.get(contact, "fields.baby_dob2", null)), new moment(_.get(contact, "fields.baby_dob3", null)), - ], _.method("isValid")), _.method("format", "YY-MM-DD")).join(", ") || $("None") + ], _.method("isValid")), _.method("format", "DD-MM-YYYY")).join(", ") || $("None") }; var dates_entry = Object.values(context); var sms_choices = [ @@ -360,7 +360,7 @@ go.app = function() { accept_labels: true, options_per_page: null, characters_per_page: 160, - error: $("Sorry we don't understand. Please try again."), + error: $("Sorry we don't understand. Pls try again."), choices: channel == "WhatsApp" ? whatsapp_choices : sms_choices, more: $("Next"), back: $("Previous"), diff --git a/test/ussd_popi_rapidpro.test.js b/test/ussd_popi_rapidpro.test.js index b9f4be85..642adc67 100644 --- a/test/ussd_popi_rapidpro.test.js +++ b/test/ussd_popi_rapidpro.test.js @@ -407,8 +407,8 @@ describe("ussd_popi_rapidpro app", function() { "What would you like to change?", "1. Cell number", "2. Change SMS to WhatsApp", - "3. Baby's Expected Due Date: 20-06-04", - "4. 1st Baby's DoB: 21-03-10", + "3. Baby's Expected Due Date: 04-06-2020", + "4. 1st Baby's DoB: 10-03-2021", "5. Next" ].join("\n") }) @@ -428,8 +428,8 @@ describe("ussd_popi_rapidpro app", function() { .check.interaction({ reply: [ "What would you like to change?", - "1. 2nd Baby's DoB: 21-11-11", - "2. 3rd Baby's DoB: 22-07-07", + "1. 2nd Baby's DoB: 11-11-2021", + "2. 3rd Baby's DoB: 07-07-2022", "3. Language", "4. ID", "5. Research msgs", @@ -453,8 +453,8 @@ describe("ussd_popi_rapidpro app", function() { "What would you like to change?", "1. Cell number", "2. Change WhatsApp to SMS", - "3. Baby's Expected Due Date: 20-06-04", - "4. 1st Baby's DoB: 21-03-10", + "3. Baby's Expected Due Date: 04-06-2020", + "4. 1st Baby's DoB: 10-03-2021", "5. Next" ].join("\n") }) @@ -474,8 +474,8 @@ describe("ussd_popi_rapidpro app", function() { .check.interaction({ reply: [ "What would you like to change?", - "1. 2nd Baby's DoB: 21-11-11", - "2. 3rd Baby's DoB: 22-07-07", + "1. 2nd Baby's DoB: 11-11-2021", + "2. 3rd Baby's DoB: 07-07-2022", "3. ID", "4. Research msgs", "5. Back", @@ -893,11 +893,11 @@ describe("ussd_popi_rapidpro app", function() { .input("A") .check.interaction({ reply: [ - "Sorry we don't understand. Please try again.", + "Sorry we don't understand. Pls try again.", "1. Cell number", "2. Change SMS to WhatsApp", - "3. Baby's Expected Due Date: 20-06-04", - "4. 1st Baby's DoB: 21-03-10", + "3. Baby's Expected Due Date: 04-06-2020", + "4. 1st Baby's DoB: 10-03-2021", "5. Next" ].join("\n") })