Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
2.16.0
Description
1. Description
When using a datetime picker we can specify an allowed time window by providing a start and end date.
The issue is that, the specified dates for the boundaries are parsed always as 12h format. This causes a problem, for instance, if we specify the end boundary as 12h10m. The date will be interpreted, server side, as 00h10m causing the datepicker only to allow selecting a time before 00h10m.
2. Steps to reproduce
This issue will be visible when, the server date is between 12h and 13h.
a) Add a new HFE form definition
Create a new HFE form at https://qa-refapp.openmrs.org/openmrs/module/htmlformentry/htmlForms.list
Paste the below HTML definition for the form that gets hooked to the existing 'Visit Note' encounter type:
<htmlform formUuid="c75f120a-04ec-11e3-8780-2b40bef9a44b" formName="Target Group" formEncounterType="d7151f82-c1f3-4152-a605-2f9ea7414a79" formVersion="1.0"><htmlform formUuid="c75f120a-04ec-11e3-8780-2b40bef9a44b" formName="Target Group" formEncounterType="d7151f82-c1f3-4152-a605-2f9ea7414a79" formVersion="1.0"> <div id="data-collection"> <obsFromFragment fragment="field/datetimepicker" provider="uicommons" conceptId="CIEL:162169" initFragmentParamName="defaultDate" fragmentParams="formFieldName=intubationStarts&label=&useTime=true&endDate=$formGeneratedDatetime&classes=form-control,datetimepicker-width;id=intubationStart"/> </div> <div id="data-collection"></div> <div id="encounter-diagnoses-target"></div> <ifMode mode="VIEW" include="false"> <div id="buttons"> <submit submitClass="confirm right" submitCode="general.save"/> <button type="button" class="cancel"> <uimessage code="general.cancel"/> </button> </div> </ifMode></htmlform>
b) Add the form to the 'Visit Actions' menu:
Go to https://qa-refapp.openmrs.org/openmrs/formentryapp/forms.page?app=formentryapp.forms :
c) Open the form created above between 12h and 13h:
If we create a new encounter at 12h10m, we'll see that we can't select a time before 12h10m. It's assuming the end date as 00h10 instead.