"JQuery UI 날짜선택기 datepicker"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 32명의 중간 판 123개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{소문자}}
{{소문자}}
*jQuery UI 날짜 선택기
==개요==
*초간단 자바스크립트 달력
;jQuery UI datepicker
;jQuery UI 날짜 선택기, 데이트피커
;jQuery UI 달력
;초간단 자바스크립트 달력
;jQuery UI 튜토리얼
*jQuery UI를 가지고 간단하게 날짜 선택기(달력)을 구현할 수 있다.
*아래 소스는 YYYY-MM-DD 형식(예: 2012-03-20)을 적용한 것 외에는 기본형이다.


==1개==
==날짜 1개==
<source lang='HTML5'>
<syntaxhighlight lang='HTML5'>
<!DOCTYPE html>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<meta charset="utf-8" />
<script src="//code.jquery.com/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
   
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
<script>
<script>
$(function() {
$(function() {
$.datepicker.setDefaults({
  $( "#datepicker1" ).datepicker({
dateFormat: 'yy-mm-dd'
    dateFormat: 'yy-mm-dd'
});
  });
$( "#datepicker1" ).datepicker();
});
});
</script>
</script>
<p>생년월일: <input type="text" id="datepicker1"></p>
   
</source>
생년월일: <input type="text" id="datepicker1">
</syntaxhighlight>
<jsfiddle height='350'>utwson0u</jsfiddle>
 
==날짜 1개 한국어로==
{{참고|jQuery UI datepicker 한국어}}
<syntaxhighlight lang='html5'>
<link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>


==2개==
<source lang='HTML5'>
<!DOCTYPE html>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
<script>
<script>
$(function() {
$(function() {
$.datepicker.setDefaults({
  $( "#datepicker1" ).datepicker({
dateFormat: 'yy-mm-dd'
    dateFormat: 'yy.mm.dd',
});
    prevText: '이전 달',
$( "#datepicker1" ).datepicker();
    nextText: '다음 달',
$( "#datepicker2" ).datepicker();
    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>
</script>
<p>조회기간: <input type="text" id="datepicker1"> ~ <input type="text" id="datepicker2"></p>
   
</source>
생년월일: <input type="text" id="datepicker1">
</syntaxhighlight>
<jsfiddle height='350'>xy0d7a01</jsfiddle>
 
==날짜 2개 (예: 조회기간)==
<syntaxhighlight lang='HTML5'>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
 
<script>
    $(function() {
        $("#datepicker1, #datepicker2").datepicker({
            dateFormat: 'yy.mm.dd'
        });
    });
 
</script>
 
<p>조회기간:
    <input type="text" id="datepicker1"> ~
    <input type="text" id="datepicker2">
</p>
</syntaxhighlight>
<jsfiddle height='350'>jm5xjauz</jsfiddle>
 
==날짜 2개, 한국어로==
<syntaxhighlight lang='HTML'>
<link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script>
  $.datepicker.setDefaults({
    dateFormat: 'yy-mm',
    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,
    yearSuffix: '년'
  });
 
  $(function() {
    $("#datepicker1, #datepicker2").datepicker();
  });
 
</script>
<p>조회기간:
  <input type="text" id="datepicker1"> ~
  <input type="text" id="datepicker2">
</p>
</syntaxhighlight>
<jsfiddle height='350'>r7678mof</jsfiddle>
 
==같이 보기==
*[[jQuery UI datepicker 한국어 적용]]
*[[jQuery UI datepicker 버튼패널 표시]]
*[[jQuery UI 기간 선택]]
*[[jQuery UI datepicker 크기 조정]]
*[[jQuery datetimepicker]]
*[[jQuery UI 시간선택기 timepicker]]


[[분류:jQuery UI]]
[[분류:jQuery UI]]
[[분류: datepicker]]

2020년 11월 2일 (월) 02:53 기준 최신판

1 개요

jQuery UI datepicker
jQuery UI 날짜 선택기, 데이트피커
jQuery UI 달력
초간단 자바스크립트 달력
jQuery UI 튜토리얼
  • jQuery UI를 가지고 간단하게 날짜 선택기(달력)을 구현할 수 있다.
  • 아래 소스는 YYYY-MM-DD 형식(예: 2012-03-20)을 적용한 것 외에는 기본형이다.

2 날짜 1개

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
    
<script>
$(function() {
  $( "#datepicker1" ).datepicker({
    dateFormat: 'yy-mm-dd'
  });
});
</script>
    
생년월일: <input type="text" id="datepicker1">

3 날짜 1개 한국어로

<link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>

<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">

4 날짜 2개 (예: 조회기간)

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>

<script>
    $(function() {
        $("#datepicker1, #datepicker2").datepicker({
            dateFormat: 'yy.mm.dd'
        });
    });

</script>

<p>조회기간:
    <input type="text" id="datepicker1"> ~
    <input type="text" id="datepicker2">
</p>

5 날짜 2개, 한국어로

<link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script>
  $.datepicker.setDefaults({
    dateFormat: 'yy-mm',
    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,
    yearSuffix: '년'
  });

  $(function() {
    $("#datepicker1, #datepicker2").datepicker();
  });

</script>
<p>조회기간:
  <input type="text" id="datepicker1"> ~
  <input type="text" id="datepicker2">
</p>

6 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}