시작일 변경시 종료일과 최소날짜를 세팅 해준다.
$("#open_date").datepicker({
dateFormat: "yy-mm-dd",
prevText: '이전달', nextText: '다음달', yearSuffix: '년',
dayNamesMin: arrDayMin,
monthNames: arrMonth,
showMonthAfterYear: true
, onSelect : function (date){
const min_date = $(this).datepicker("getDate");
$("#end_date").datepicker('setDate', min_date);
$("#end_date").datepicker('option', "minDate", min_date);
}
});
$("#end_date").datepicker({
dateFormat: "yy-mm-dd",
prevText: '이전달', nextText: '다음달', yearSuffix: '년',
dayNamesMin: arrDayMin,
monthNames: arrMonth,
showMonthAfterYear: true
});
반응형
'Client Side' 카테고리의 다른 글
Drag And Drop (0) | 2023.04.05 |
---|---|
Modal Drag (0) | 2023.02.22 |
필수사항 체크 (0) | 2023.01.27 |
async & await (0) | 2023.01.27 |
FileReader 이미지 미리보기 (0) | 2023.01.26 |