개인적인 정리

datetimepicker mindate 설정 본문

Script & jQuery

datetimepicker mindate 설정

yeon.Biju 2019. 2. 24. 15:33

1. 오늘을 선택할 수 없도록 하는 것이 요구사항.



$(document).ready(function(){

var tomorrowDate = tomorrowDate();

$('#exhaustDate').datetimepicker({

  lang:'ko',

  timepicker:false,

  format:'Y-m-d',

  minDate: new Date(tomorrowDate)

});

});

function tomorrowDate(){ 

var tomorrowDate =""; 

var today = new Date(); 

var dd = today.getDate()+1; 

var mm = today.getMonth()+1; //January is 0! 

var yyyy = today.getFullYear(); 


if(dd<10) { 

dd='0'+dd 

if(mm<10) { 

mm='0'+mm 

}


tomorrowDate = yyyy+'-'+mm+'-'+dd; 


return tomorrowDate; 

}





https://xdsoft.net/jqplugins/datetimepicker/

Comments