데이터피커를 사용하기위한 css와 javascript url
<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>
datapicker 기본 설정 옵션들
$("#sDate, #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: '년'
});
datapicker 옵션 - 시작날짜와 종료날짜값이 어긋나지 않도록 하는 코드
$('#sDate').datepicker("option", "maxDate", $("#eDate").val());
$('#sDate').datepicker("option", "onClose", function ( selectedDate ) {
$("#eDate").datepicker( "option", "minDate", selectedDate );
});
$('#eDate').datepicker("option", "minDate", $("#sDate").val());
$('#eDate').datepicker("option", "onClose", function ( selectedDate ) {
$("#sDate").datepicker( "option", "maxDate", selectedDate );
});
datapicker시작 날짜 설정
$('#sDate').datepicker("option", "maxDate", $("#eDate").val());