Ver código fonte

격리해제 예정일 빈값 처리

huiwon.seo 4 anos atrás
pai
commit
2f3d477082

+ 24 - 7
src/main/webapp/WEB-INF/jsp/patient/edit.jsp

@@ -101,12 +101,7 @@ function setEventHandler(){
         
         wrap.find( "input.error-box" ).val( dateYear  + "-" + dateMonth  + "-" + dateDay );
     });
-}
-$( function(){
-    patientNewInit();
-    setEventHandler();
-    $( ".hospitalizationDate" ).trigger( "change" );
-    $( ".select-date" ).trigger( "change" );
+    
     
     $( "input.date" ).daterangepicker({
         singleDatePicker : true,
@@ -116,6 +111,26 @@ $( function(){
         }
     });
     
+    $( "input.date-no-req" ).daterangepicker({
+        singleDatePicker : true,
+        showDropdowns : true,
+        locale : {
+            format : "YYYY-MM-DD"
+        },
+        autoUpdateInput: false
+    });
+    
+    $('input.date-no-req').on('apply.daterangepicker', function(ev, picker) {
+        $(this).val(picker.startDate.format('YYYY-MM-DD'));
+    });
+}
+
+$( function(){
+    patientNewInit();
+    setEventHandler();
+    $( ".hospitalizationDate" ).trigger( "change" );
+    $( ".select-date" ).trigger( "change" );
+    
     $( "#patientForm" ).validate({
         rules: {
             hospitalizationDate : {
@@ -346,7 +361,9 @@ $( function(){
                                                     <th>격리해제 예정일</th>
                                                     <td>
                                                         <div class="form-group calendar-bar mb-xl-0">
-                                                            <input class="form-control date" type="text" value="${patientData.disisolationDate}" name="disisolationDate">
+                                                            <fmt:parseDate var="disisolationDateTime" value="${patientData.disisolationDate}" pattern="yyyy-MM-dd HH:mm" />
+                                                            <c:set var="disisolationDate"><fmt:formatDate value="${disisolationDateTime}" pattern="yyyy-MM-dd" /></c:set>
+                                                            <input class="form-control date-no-req" type="text" value="${disisolationDate}" name="disisolationDate">
                                                             <i class="align-middle mr-2 fas fa-fw fa-calendar-alt"></i>
                                                         </div>
                                                     </td>

+ 0 - 2
src/main/webapp/WEB-INF/jsp/patient/new.jsp

@@ -105,7 +105,6 @@ function setEventHandler(){
         singleDatePicker : true,
         showDropdowns : true,
         locale : {
-            //format : "M/DD hh:mm A"
             format : "YYYY-MM-DD"
         }
     });
@@ -114,7 +113,6 @@ function setEventHandler(){
         singleDatePicker : true,
         showDropdowns : true,
         locale : {
-            //format : "M/DD hh:mm A"
             format : "YYYY-MM-DD"
         },
         autoUpdateInput: false