본문으로 바로가기

jquery datepicker + monthpicker

category [ Web 관련 ]/jQuery 2019. 10. 29. 17:43

<!-- datepicker 관련-->
<link rel="stylesheet" href="/static/assets/plugin/datepicker/1.12.1/jquery-ui.css">
<script src="/static/assets/plugin/datepicker/jquery-1.12.4.js"></script>
<script src="/static/assets/plugin/datepicker/1.12.1/jquery-ui.js"></script>
<script src="/static/assets/plugin/datepicker/jquery.mtz.monthpicker.js"></script>

 

<script>

$(function() {
$( ".datepicker" ).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,
yearSuffix: ''
});


/* MonthPicker Set */
$('.datepicker-month').monthpicker({
pattern: 'yyyy-mm', // Default is 'mm/yyyy' and separator char is not mandatory
monthNames: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
});

});

</script>

 

 

 

 

<input type="text" name="sdate" class="datepicker" readonly autocomplete='off' >

 

<input type="text" name="edate" class="datepicker-month" readonly autocomplete='off' >

 

 

 

datepicker.zip
0.22MB