1 2//var $ = jQuery.noConflict(); 3 4$(document).ready(function(){ 5 // defult 6 /* 7 $("#startValue").val(getCalculatedDate(0,0,0,'-')) 8 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 9 /* 10 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 11 $("#endValue_group").val(getCalculatedDate(0,0,0,'-')) 12 */ 13 14 setJqDate(); 15 16 $('.dateGroup') 17 .append('<span style="border:none;"><input type="button" value="1ì¼" class="dayBt" id="1day"/></span>') 18 .append(' <span style="border:none;"><input type="button" value="1주ì¼" class="dayBt" id="1week"/></span>') 19 .append(' <span style="border:none;"><input type="button" value="10ì¼" class="dayBt" id="10days"/></span>') 20 .append(' <span style="border:none;"><input type="button" value="15ì¼" class="dayBt" id="15days"/></span>') 21 .append(' <span style="border:none;"><input type="button" value="1ê°ì" class="dayBt" id="1month"/></span>') 22 .append(' <span style="border:none;"><input type="button" value="3ê°ì" class="dayBt" id="3month"/></span>') 23 //.append(' <span style="border:none;"><input type="button" value="6ê°ì" class="dayBt" id="6month"/></span>'); 24 25 // date 26 $("#6month").click(function(){ 27 $("#startValue").val(getCalculatedDate(0,-6,0,'-')) 28 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 29 }); 30 31 $("#3month").click(function(){ 32 $("#startValue").val(getCalculatedDate(0,-3,0,'-')) 33 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 34 }); 35 36 $("#1month").click(function(){ 37 $("#startValue").val(getCalculatedDate(0,-1,0,'-')) 38 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 39 }); 40 41 $("#15days").click(function(){ 42 $("#startValue").val(getCalculatedDate(0,0,-15,'-')) 43 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 44 }); 45 46 $("#10days").click(function(){ 47 $("#startValue").val(getCalculatedDate(0,0,-10,'-')) 48 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 49 }); 50 51 $("#1week").click(function(){ 52 $("#startValue").val(getCalculatedDate(0,0,-7,'-')) 53 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 54 }); 55 56 $("#1day").click(function(){ 57 $("#startValue").val(getCalculatedDate(0,0,0,'-')) 58 $("#endValue").val(getCalculatedDate(0,0,0,'-')) 59 }); 60 61 // group 62 63 $("#6month_group").click(function(){ 64 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 65 $("#endValue_group").val(getCalculatedDate(0,-6,0,'-')) 66 }); 67 68 $("#3month_group").click(function(){ 69 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 70 $("#endValue_group").val(getCalculatedDate(0,-3,0,'-')) 71 }); 72 73 $("#1month_group").click(function(){ 74 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 75 $("#endValue_group").val(getCalculatedDate(0,-1,0,'-')) 76 }); 77 78 $("#15days_group").click(function(){ 79 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 80 $("#endValue_group").val(getCalculatedDate(0,0,-15,'-')) 81 }); 82 83 $("#10days_group").click(function(){ 84 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 85 $("#endValue_group").val(getCalculatedDate(0,0,-10,'-')) 86 }); 87 88 $("#1week_group").click(function(){ 89 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 90 $("#endValue_group").val(getCalculatedDate(0,0,-7,'-')) 91 }); 92 93 $("#1day_group").click(function(){ 94 $("#startValue_group").val(getCalculatedDate(0,0,0,'-')) 95 $("#endValue_group").val(getCalculatedDate(0,0,0,'-')) 96 }); 97}); 98 99function setJqDate() { 100 if($(".jqDate").datepicker){ 101 $(".jqDate").datepicker({ 102 altField: '20101122', 103 altFormat: 'yy-mm-dd', 104 dateFormat: 'yy-mm-dd', 105 showOn: 'button', 106 buttonImage: CTX+'/resource/image/calender.gif', 107 buttonImageOnly: true, 108 changeMonth: true, 109 changeYear: true, 110 showMonthAfterYear:true, 111 monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"], 112 dayNamesMin:["ì¼","ì","í","ì","목","ê¸","í "], 113 onSelect:function(dateText, inst) { 114 validSearchDate($(this)); 115 } 116 117 }) 118 .attr("maxlength", 10) 119 .blur(function(){ 120 if($(this).val() != "") { 121 if(!validDate($(this).val())) { 122 alert("ë ì§ê° ì¬ë°ë¥´ì§ ììµëë¤."); 123 $(this).val("").focus(); 124 }else { 125 validSearchDate($(this)); 126 $(this).val(dateFormat($(this).val())); 127 } 128 } 129 }); 130 } 131} 132 133 134function validSearchDate(obj) { 135 136 if($("#startValue").is("input") && $("#endValue").is("input")){ 137 if($("#endValue").val()!="" && $("#startValue").val()!="") { 138 if($("#startValue").val().replace("-", "").replace("-", "") > $("#endValue").val().replace("-", "").replace("-", "")) { 139 alert("ììì¼ì´ ì¢ ë£ì¼ë³´ë¤ í¼ëë¤."); 140 obj.val("").focus(); 141 return false; 142 } 143 144 if($("#endValue").val().replace("-", "").replace("-", "") < $("#startValue").val().replace("-", "").replace("-", "")) { 145 alert("ì¢ ë£ì¼ì´ ììì¼ë³´ë¤ ììµëë¤."); 146 obj.val("").focus(); 147 return false; 148 } 149 } 150 } 151} 152 153function getCalculatedDate(iYear, iMonth, iDay, seperator) 154{ 155 //íì¬ ë ì§ ê°ì²´ë¥¼ ì»ì´ì´. 156 var gdCurDate = new Date(); 157 //íì¬ ë ì§ì ë ì§ ê²ì°. 158 gdCurDate.setYear( gdCurDate.getFullYear() + iYear ); 159 gdCurDate.setMonth( gdCurDate.getMonth() + iMonth ); 160 gdCurDate.setDate( gdCurDate.getDate() + iDay ); 161 162 //ì¤ì ì¬ì©í ì°, ì, ì¼ ë³ì ë°ê¸°. 163 var giYear = gdCurDate.getFullYear(); 164 var giMonth = gdCurDate.getMonth()+1; 165 var giDay = gdCurDate.getDate(); 166 //ì, ì¼ì ì릿ì를 2ìë¦¬ë¡ ë§ì¶ë¤. 167 giMonth = "0" + giMonth; 168 giMonth = giMonth.substring(giMonth.length-2,giMonth.length); 169 giDay = "0" + giDay; 170 giDay = giDay.substring(giDay.length-2,giDay.length); 171 //display íí ë§ì¶ê¸°. 172 return giYear + seperator + giMonth + seperator + giDay; 173} 174 175 176//ë ì§ ì í¨ì± ê²ì¦ 177function validDate(checkDate ) { 178 iDate = replaceAll(checkDate, "-", ""); 179 if(iDate.length != 8){ 180 return false; 181 } 182 183 year = iDate.substring(0, 4);
184 month = iDate.substring(4, 6); 185 month = month - 1; // javascript month range : 0- 11 186 day = iDate.substring(6); 187 var tempDate = new Date(year,month, day); 188 189 if ( (tempDate.getFullYear() == year) && 190 (month == tempDate.getMonth()) && 191 (day == tempDate.getDate()) ){ 192 return true; 193 }else{ 194 return false 195 } 196} 197 198function dateFormat(date) { 199 if(date=="") { 200 return ""; 201 } 202 203 iDate = replaceAll(date, "-", ""); 204 year = iDate.substring(0, 4); 205 month = iDate.substring(4, 6); 206 day = iDate.substring(6); 207 208 giYear = year; 209 giMonth = "0" + month; 210 giMonth = giMonth.substring(giMonth.length-2,giMonth.length); 211 giDay = "0" + day; 212 giDay = giDay.substring(giDay.length-2,giDay.length); 213 214 return giYear + "-" + giMonth + "-" + giDay; 215}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.