Front/JS & jQuery

[jQuery][daterangepicker] daterangepicker 날짜 제한

오선지♬ 2022. 10. 9. 16:41
728x90
반응형

옵션에 maxDate, minDate 추가

⬇️

var date = new Date();
var startDate =  new Date(date.getFullYear(), date.getMonth(), 1); // 이번달 1일
var endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0); // 이번달 마지막 날


maxDate: moment(startDate).format('YYYYMMDD'),

minDate: moment(endDate).format('YYYYMMDD')
728x90
반응형

'Front > JS & jQuery' 카테고리의 다른 글

[js] 객체와 property  (0) 2022.10.12
[js] Object.assign()  (0) 2022.10.11
[js] 이번달의 1일과 마지막날 구하기  (0) 2022.10.08
[js] for문 알아둘 점, 주의 할 점  (0) 2022.10.07
[js] switch 문 vs if 문  (1) 2022.10.06