검색시 시작일~종료일 이때
종료일을 오늘 날짜부터 1달전까지만 검색되도록 성정하려면 어떻게 할 수 있을련지요,?
<input class='ed' type=t1_end name='t1_end' size=12 itemname='마지막일' value='<?=$t1_end?>' >
이렇게 했습니다.
달력을 다른 곳에서도 쓰니 이 input에서만 1달전까지만으로 제한할 수 있을까요?
<script>
$(function() {
$( "#t_start, #t_end, #t_start1, #t_end1, #t_start2, #t_end2" ).datepicker({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
changeYear: true,
changeMonth: true,
monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
showMonthAfterYear: true,
yearSuffix: '년'
});
});
</script>
답변 2개 / 댓글 5개
<script>
$(function() {
$( "#t_start, #t_end, #t_start1, #t_end1, #t_start2, #t_end2" ).datepicker({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
changeYear: true,
changeMonth: true,
monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
showMonthAfterYear: true,
yearSuffix: '년'
});
});
</script>
이렇게 한개로 모두 불러오는 부분을 두개로 나누시면 됩니다
$( "#t_start, #t_end, #t_end1, #t_start2, #t_end2" ).datepicker({
~~~~~~~~~~
});
이부분만 이렇게 하고 나머지는 그대로 사용
$("#t_start1).datepicker({
~~~~~~~
});
이렇게 해서 또 사용
이런식으로 여러개 사용이 가능합니다
답변에 대한 댓글 2개
아마 이거였던거 같아요 년월일로다가
yearRange: 'c-99:c+99', minDate: '-180MM', maxDate: '+12M'
답변에 대한 댓글 3개
그런데 해당 페이지에서
#t_start, #t_end, #t_start1, #t_end1, #t_start2, #t_end2 이렇게 몇개를 쓰고 있습니다.
#t_end1에 대해서만 종료일을 두고 싶은데..알려주신대로 해도 될까요?
다른 인풋은 원래대로구요,,
뒤에 , 찍고 넣으시면 적용될겁니다
숫자 조정하면 날짜도 조정됩니다
제가 착각했네요...오늘부터 1달이내만 검색되도록 하려면
시작일을 만져야 하는군요,,,
<input class='ed' type=t1_start name='t1_start' size=12 itemname='시작일' value='<?=$t1_start?>' >
답변을 작성하려면 로그인이 필요합니다.
매번 시간뺏는거 같아 죄송스럽습니다.
감사합니다.