Uploaded image for project: 'UI Commons Module '
  1. UI Commons Module
  2. UICM-97

Datepicker range not considering 24h format

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • 2.16.0
    • 2.17.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.

      Gliffy Diagrams

        Attachments

          1. image-2021-04-08-15-31-28-601.png
            image-2021-04-08-15-31-28-601.png
            45 kB
          2. image-2021-04-08-15-55-38-954.png
            image-2021-04-08-15-55-38-954.png
            33 kB
          3. image-2021-04-08-16-49-43-522.png
            image-2021-04-08-16-49-43-522.png
            18 kB
          4. image-2021-04-08-16-50-27-245.png
            image-2021-04-08-16-50-27-245.png
            49 kB
          5. image-2021-04-08-16-50-37-458.png
            image-2021-04-08-16-50-37-458.png
            18 kB
          6. image-2021-04-08-16-50-47-456.png
            image-2021-04-08-16-50-47-456.png
            49 kB

          Activity

            People

              icrc.psousa Pedro Sousa
              icrc.psousa Pedro Sousa
              Dimitri R Dimitri R
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: