Skip to content

Commit

Permalink
Merge pull request #609 from praekeltfoundation/feature-edd-date-form…
Browse files Browse the repository at this point in the history
…at-update

Update edd and dob date format to dd-mm-yyyy
  • Loading branch information
DevChima authored Oct 17, 2023
2 parents f405ef4 + 4555077 commit b04b080
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions go-app-ussd_popi_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions src/ussd_popi_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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"),
Expand Down
22 changes: 11 additions & 11 deletions test/ussd_popi_rapidpro.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
Expand All @@ -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",
Expand All @@ -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")
})
Expand All @@ -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",
Expand Down Expand Up @@ -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")
})
Expand Down

0 comments on commit b04b080

Please sign in to comment.