2017-01-03 1 views
0

내 응용 프로그램에 daterangepicker를 사용했습니다.DateRangePicker - autoUpdateInput : false, autoapply : true not working

  1. 다음 코드는 예상대로 작동합니다. 오늘 날짜와 표시를 선택하면로드됩니다. 하지만 '자리 표시 자'값만 표시해야합니다. 데이트 상대가 아니야.
  2. autoUpdateInput : false를 사용하면 '자리 표시 자'값이 표시됩니다. 그러나 날짜를 선택한 후에는 선택한 날짜 값이 삽입되지 않습니다.
  3. autoUpdateInput을 수행 할 수 있습니까? false 및 autoApply : true 내 애플리케이션에서 예상대로 작동합니까?

감사

JS :

$('input[name="Two way"]').daterangepicker({ 
    "autoApply": true, 
    "minDate": today, 
    "locale": { 
     format: 'DD MMM YYYY' 
    } 
}); 

답변

0

당신은이에 대한 function(start,end) {}를 사용할 수 있습니다. 이것

봐 :

 $('#start_date').daterangepicker({ 
      "showDropdowns": true, 
      "autoApply": true, 
      locale: { 
       format: 'DD/MM/YYYY' 
      },autoclose: true, 
      "alwaysShowCalendars": true, 
      "startDate": '<%= start_date %>', 
      "endDate": '<%= end_date %>' 
     }, function(start, end) { 
       $("#start_date_input").val(start.format('DD/MM/YYYY')); 
       $("#end_date_input").val(end.format('DD/MM/YYYY')); 
       Materialize.updateTextFields(); 
     } 
    ); 
    $('#start_date').on("change", function(){ 
     console.log("changes"); 
    });