본문 바로가기

datepicker

modal 팝업창에서 datepicker 사용 시 연도 월 Select box가 열리지 않는 문제 해결 방법 Bootstrap modal 팝업창에서 datepicker 사용 시 changeMonth , changeYear 옵션을 true 로 사용할 경우 정상적으로 펼쳐지지 않고 바로 닫히는 버그가 있는데 꽤 오래된 상황임에도 업데이트가 되어지지 않고 있습니다. 하지만, 역시 스택오버플로우 https://stackoverflow.com/questions/22050641/month-select-in-datepicker-inside-a-bootstrap-modal-wont-work-in-firefox 해결 방안을 제시해줍니다. $('#modal').on('show', function () { $.fn.modal.Constructor.prototype.enforceFocus = function () { }; }); 위.. 더보기
jQuery 동적으로 추가된 객체에 datepicker() 적용하기 동적으로 추가(append)되거나 복제된(clone) 객체에서 DatePicker()가 작동하지 않는 문제가 확인되어 구글링을 통해 방법들을 찾아보니 hasDatepicker Class가 문제 인지라.. 해당 클래스 제거 후 다시 DatePicker 설정을 해줘야 작동합니다. // 지정된 객체 처리시 $(this).removeClass('hasDatepicker').datepicker(); // 클래스를 이용한 처리 $(document).find(".JCaldendar").removeClass('hasDatepicker').datepicker({ dateFormat: "yy-mm-dd", defaultDate: "+1w", numberOfMonths: 1, changeMonth: true, showMon.. 더보기
jQuery datepicker 달력 샘플 API Url : http://jqueryui.com/datepicker/ Document : http://api.jqueryui.com/datepicker/ Test Url : http://www.uhoon.co.kr/test/1876.html 딱히 설명이 필요없는....달력입니다.. DatePicker 다양한 기능이 있지만 개인적으로 주로 사용하는 옵션은 아래와 같습니다.. 주로 영문상태를 쓰지만 요일, 월 한글명은 필수옵션은 아닙니다. * 기간 선택 - 시작일 변경시 종료일 min Date 를 시작일로 변경 - 종료일 변경시 시작일의 max Date 를 종료일로 변경 날짜 기간 ~ 더보기