jsp에 설정된 선언한 상태. foundation-datepicker임을 주의
1
2
3
4
5
6
|
<link href="<c:url value='/js/foundation/foundation.min.css'/>">
<script src="<c:url value='/js/foundation/foundation.min.js'/>"></script>
<link href="<c:url value='/js/foundation/foundation-datepicker.min.css'/>" rel="stylesheet">
<script src="<c:url value='/js/foundation/foundation-datepicker.min.js'/>"></script>
<link href="<c:url value='/js/foundation/foundation-icons/foundation-icons.css'/>" rel="stylesheet">
<script src="<c:url value='/js/foundation/locale/foundation-datepicker.ko.js'/>"></script>
|
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
29
30
31
|
$(function(){
var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp
.getDate(), 0, 0, 0, 0);
var checkin = $('#startDate').fdatepicker({
format : 'yyyy-mm',
pickTime : false,
language : 'ko',
onRender : function(date) {
}
}).on('changeDate', function(ev) {
// if (ev.date.valueOf() > checkout.date.valueOf()) {
// var newDate = new Date(ev.date)
// newDate.setDate(newDate.getDate() + 1);
// checkout.update(newDate);
// }
$('#endDate')[0].focus();
}).data('datepicker');
var checkout = $('#endDate').fdatepicker({
format : 'yyyy-mm',
pickTime : false,
language : 'ko',
onRender : function(date) {
return date.valueOf() < checkin.date.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function(ev) {
}).data('datepicker');
});
Colored by Color Scripter
|
일별 달력이 아닌 월별 달력으로 바꾸기 위해서는 input 태그에 start-view, min-view속성을 추가해줘야 한다.
1
2
3
4
5
|
<input type="text" class="onetp130" name="searchStartDate" id="startDate" value="<c:out value='${statisticsSearchVO.searchStartDate}'/>" readonly="readonly" data-start-view="year" data-min-view="year" />
<em class="cuponiter"><img src="<c:url value='/images/common/cldicon.png'/>" alt="달력" id="dp1" onclick="startImg();" ></em> ~
<input type="text" class="onetp130" name="searchEndDate" id="endDate" value="<c:out value='${statisticsSearchVO.searchEndDate}'/>" readonly="readonly" data-start-view="year" data-min-view="year" >
<em class="cuponiter"><img src="<c:url value='/images/common/cldicon.png'/>" alt="달력" id="dp2" onclick="endImg();" ></em>
colored by Color Scripter
|
참고
'소소한 지식모음' 카테고리의 다른 글
구글 지도 API 이용중 이슈 : grey screen (0) | 2019.12.02 |
---|---|
return false, NVL, where 1=1, 커스텀태그 (0) | 2019.12.02 |
[생활코딩] AJAX (0) | 2019.06.02 |
[펌] SiteMesh 이용 (0) | 2019.06.02 |
회사다니면서 새로 알게된 잡지식_02 (0) | 2019.06.02 |
댓글