|
|
|
@ -3,40 +3,47 @@ function initDatepicker(elementId){
|
|
|
|
|
var executionArea = $("#"+elementId);
|
|
|
|
|
|
|
|
|
|
/*--------------------- 달력 제어 ---------------------*/
|
|
|
|
|
executionArea.find(".form-date").datepicker()
|
|
|
|
|
.attr("maxlength", "10")
|
|
|
|
|
.on("input",function(e){
|
|
|
|
|
executionArea.find(".form-date").each(function(){
|
|
|
|
|
|
|
|
|
|
if(this.value.length <= 0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.value.length != this.selectionStart){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var value = this.value.replaceAll("-","");
|
|
|
|
|
|
|
|
|
|
if(value.length > 7){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4,6)+"-"+value.substring(6);
|
|
|
|
|
} else if(value.length > 5){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4);
|
|
|
|
|
}
|
|
|
|
|
$(this)
|
|
|
|
|
.datepicker()
|
|
|
|
|
.attr("maxlength", "10")
|
|
|
|
|
.on("input",function(e){
|
|
|
|
|
|
|
|
|
|
if(this.value.length <= 0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.value.length != this.selectionStart){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.on("paste", function(e){
|
|
|
|
|
var value = this.value.replaceAll("-","");
|
|
|
|
|
|
|
|
|
|
if(value.length > 7){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4,6)+"-"+value.substring(6);
|
|
|
|
|
} else if(value.length > 5){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.on("paste", function(e){
|
|
|
|
|
|
|
|
|
|
var value = e.originalEvent.clipboardData.getData('text');
|
|
|
|
|
if(value.length == 8){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4,6)+"-"+value.substring(6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var value = e.originalEvent.clipboardData.getData('text');
|
|
|
|
|
if(value.length == 8){
|
|
|
|
|
this.value = value.substring(0,4)+"-"+value.substring(4,6)+"-"+value.substring(6);
|
|
|
|
|
})
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
var calendarIcon = $(this).next("button.bx-calendar");
|
|
|
|
|
if(calendarIcon.length > 0){
|
|
|
|
|
$(calendarIcon).on("click", function() {
|
|
|
|
|
$(this).prev().focus();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
executionArea.find(".form-date").next("button.bx-calendar").on("click", function() {
|
|
|
|
|
$(this).prev().focus();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initDetailSearchButton(elementId){
|
|
|
|
|