Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configuration/pih/htmlforms/covid19Intake.xml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
<span id="calculated-edd-label">
<uimessage code="pihcore.calculatedEstimatedDeliveryDate"/>:&#160;
</span><br/>
<span id='calculated-edd' class="calculated-edd value"></span>
<span id='calculated-edd-value' class="calculated-edd value"></span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't insist on using ids @cioan . If you are going to write code that simulates using classes, you might as well use them.

</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion configuration/pih/htmlforms/section-history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
<span id="calculated-edd-label">
<uimessage code="pihcore.calculatedEstimatedDeliveryDate"/>:&#160;
</span><br/>
<span id='calculated-edd' class="calculated-edd value"></span>
<span id='calculated-edd-value' class="calculated-edd value"></span>
</span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions configuration/pih/htmlforms/section-obgyn-initial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@
<span id="calculated-edd-label">
<uimessage code="pihcore.calculatedEstimatedDeliveryDate"/>:&#160;
</span><br/>
<span id='calculated-edd' class="calculated-edd value"></span>
<span id='calculated-edd-value' class="calculated-edd value"></span>
</span>
</div>
</div>
Expand Down Expand Up @@ -1710,7 +1710,7 @@
<span id="calculated-edd-label">
<uimessage code="pihcore.calculatedEstimatedDeliveryDate"/>:&#160;
</span><br/>
<span id='calculated-edd' class="calculated-edd value"></span>
<span id='calculated-edd-value' class="calculated-edd value"></span>
</span>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions configuration/pih/scripts/global/mch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down