From 883f94dde95bad024c20638e62a15e6e0c28299b Mon Sep 17 00:00:00 2001 From: Cosmin Date: Thu, 1 Aug 2024 16:34:34 -0400 Subject: [PATCH] UHM-8098: update multiple edd elements on the same form --- configuration/pih/htmlforms/covid19Intake.xml | 2 +- configuration/pih/htmlforms/section-history.xml | 2 +- configuration/pih/htmlforms/section-obgyn-initial.xml | 4 ++-- configuration/pih/scripts/global/mch.js | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configuration/pih/htmlforms/covid19Intake.xml b/configuration/pih/htmlforms/covid19Intake.xml index 99ea0f61..d279a2bc 100644 --- a/configuration/pih/htmlforms/covid19Intake.xml +++ b/configuration/pih/htmlforms/covid19Intake.xml @@ -349,7 +349,7 @@
- + diff --git a/configuration/pih/htmlforms/section-history.xml b/configuration/pih/htmlforms/section-history.xml index 6d1fb1fb..7339edf8 100644 --- a/configuration/pih/htmlforms/section-history.xml +++ b/configuration/pih/htmlforms/section-history.xml @@ -518,7 +518,7 @@
- + diff --git a/configuration/pih/htmlforms/section-obgyn-initial.xml b/configuration/pih/htmlforms/section-obgyn-initial.xml index 9582c7b6..7b2663a4 100644 --- a/configuration/pih/htmlforms/section-obgyn-initial.xml +++ b/configuration/pih/htmlforms/section-obgyn-initial.xml @@ -1509,7 +1509,7 @@
- + @@ -1710,7 +1710,7 @@
- + diff --git a/configuration/pih/scripts/global/mch.js b/configuration/pih/scripts/global/mch.js index b5d13d0b..55937b33 100644 --- a/configuration/pih/scripts/global/mch.js +++ b/configuration/pih/scripts/global/mch.js @@ -26,16 +26,16 @@ function setUpEdd(currentEncounterDate, msgWeeks) { const gestAgeText = calculateGestationalDays(lastPeriodDate, currentEncounterDate, msgWeeks); const edd = calculateExpectedDeliveryDate(lastPeriodDate); const locale = window.sessionContext.locale || navigator.language; - jq("#calculated-edd-and-gestational").show(); + jq("div[id^=calculated-edd-and-gestational]").show(); getField("edd.value").datepicker("setDate", edd); - jq("#calculated-edd").text((Intl.DateTimeFormat(locale, { dateStyle: "medium" })).format(edd)); - jq("#calculated-gestational-age-value").text(gestAgeText); + jq("span[id^=calculated-edd-value]").text((Intl.DateTimeFormat(locale, { dateStyle: "medium" })).format(edd)); + jq("span[id^=calculated-gestational-age-value]").text(gestAgeText); } else { - jq("#calculated-edd-and-gestational").hide(); + jq("div[id^=calculated-edd-and-gestational]").hide(); } }; - jq("#calculated-edd-and-gestational").hide(); + jq("div[id^=calculated-edd-and-gestational]").hide(); jq("#lastPeriodDate input[type='hidden']").change(function () { updateEdd(); });