Parcourir la source

Merge branch 'databank' of http://wcollector.idatabank.com:5230/dbs289/LifeCenter into sudden

huiwonseo il y a 4 ans
Parent
commit
22f7093376
1 fichiers modifiés avec 23 ajouts et 9 suppressions
  1. 23 9
      src/main/webapp/WEB-INF/jsp/patient/list.jsp

+ 23 - 9
src/main/webapp/WEB-INF/jsp/patient/list.jsp

@@ -16,14 +16,14 @@ $(function() {
             format : "YYYY-MM-DD"
         },
         autoUpdateInput: false,
-        maxDate : new Date()
+        // maxDate : new Date()
     }).on('apply.daterangepicker', function(ev, picker) {
         $(this).val(picker.startDate.format('YYYY-MM-DD'));
         
         $(this).trigger( "change" );
     }).on( "change", function(){
         if( $( this ).val() > getNowYmd() ) {
-            $( this ).val( getNowYmd() );
+            // $( this ).val( getNowYmd() );
         }
     });
     
@@ -52,22 +52,36 @@ $(function() {
                 format : "YYYY-MM-DD"
             },
             autoUpdateInput: false,
-            maxDate : $("input[name='endDate']").val()
+            // maxDate : $("input[name='endDate']").val()
         }).on('apply.daterangepicker', function(ev, picker) {
             $(this).val(picker.startDate.format('YYYY-MM-DD'));
             $(this).trigger( "change" );
+
+            if( $( this ).val() > $("input[name='endDate']").val() ) {
+               $("input[name='endDate']").val( $( this ).val() );
+            }
         });
         
         if( $("input[name='endDate']").val() != "" ){
-            if( $("input[name='startDate']").val() > $("input[name='endDate']").val() ) {
-                $("input[name='startDate']").val( $( this ).val() );
-            }
+            // if( $("input[name='startDate']").val() > $("input[name='endDate']").val() ) {
+            //     $("input[name='startDate']").val( $( this ).val() );
+            // }
         }
         
         if( $("input[name='endDate']").val() != "" ){
-            if( $("input[name='startDate']").val() > $("input[name='endDate']").val() ) {
-                $("input[name='startDate']").val( $("input[name='endDate']").val() );
-            }
+            // if( $("input[name='startDate']").val() > $("input[name='endDate']").val() ) {
+            //     $("input[name='startDate']").val( $("input[name='endDate']").val() );
+            // }
+        }
+    });
+
+
+    $( "#dateType" ).on( "change", function() {
+        var dateType = $( this ).val();
+        if( dateType == 'D' ) {
+             $("input[name='endDate']")
+        } else {
+             $("input[name='endDate']")
         }
     });