반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- php
- html5
- 워드프레스플러그인
- JavaScript
- 댕댕이
- 워드프레스소개
- css3
- 웹호스팅
- 반응형웹
- 네이버웹마스터도구
- Wordpress
- 반응형홈페이지
- 무료호스팅서버
- MySQL
- 그누보드
- 워드프레스홈페이지제작
- 제이쿼리
- 워드프레스
- 워드프레스란?
- Linux
- 무료호스팅
- 자바스크립트
- 플러그인설치방법
- 영카트
- jQuery
- 기업홈페이지제작
- 반려견
- 닷홈
- 카페24
- 병원홈페이지제작
Archives
- Today
- Total
pm1122dev의 비밀노트
제이쿼리 datepicker 사용하기 본문
728x90
반응형
<link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" />
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<style>
.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year{
width:45%!important;
}
</style>
// 날짜선택이 하나일 경우
<script>
$(function() {
$( "#datepicker1" ).datepicker({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
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,
changeMonth: true,
changeYear: true,
yearSuffix: '년'
});
});
</script>
생년월일: <input type="text" id="datepicker1">
yearRange: "-100:+0", //연도 범위
// 날자썬택이 시작과 종료일
<script>
$( "#sdate" ).datepicker({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
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,
changeMonth: true,
changeYear: true,
yearSuffix: '년',
yearRange: "-100:+0",
onClose: function( selectedDate ) {
// 시작일(fromDate) datepicker가 닫힐때
// 종료일(toDate)의 선택할수있는 최소 날짜(minDate)를 선택한 시작일로 지정
$("#edate").datepicker( "option", "minDate", selectedDate );
}
});
$( "#edate" ).datepicker({
dateFormat: 'yy-mm-dd',
prevText: '이전 달',
nextText: '다음 달',
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,
changeMonth: true,
changeYear: true,
yearSuffix: '년',
onClose: function( selectedDate ) {
// 시작일(fromDate) datepicker가 닫힐때
// 종료일(toDate)의 선택할수있는 최소 날짜(minDate)를 선택한 시작일로 지정
$("#sdate").datepicker( "option", "maxDate", selectedDate );
}
});
</script>
728x90
반응형
'javascript&jquery' 카테고리의 다른 글
swiperjs 원하는 위치로 이동 (0) | 2021.01.23 |
---|---|
swiperjs 여러개 사용하기 (0) | 2021.01.23 |
li, table 드래그 앤 드롭 사용하기 (0) | 2021.01.23 |
숫자 천단위 , 라이브러리 (0) | 2021.01.23 |
업로드한 이미지를 미리보고싶은 경우 사용하는 FileReader API (2) | 2019.04.03 |
Comments