datepicker 수정
parent
7f85eb96ed
commit
9d50a7c092
@ -1,107 +0,0 @@
|
||||
$.fn.datepicker.makeTemplate = function(){
|
||||
this.DPGlobal.template = '<div class="datepicker">'+
|
||||
'<div class="datepicker-days">'+
|
||||
'<table class="table-condensed">'+
|
||||
this.DPGlobal.headTemplate+
|
||||
'<tbody></tbody>'+
|
||||
this.DPGlobal.footTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-months">'+
|
||||
'<table class="table-condensed">'+
|
||||
this.DPGlobal.headTemplate+
|
||||
this.DPGlobal.contTemplate+
|
||||
this.DPGlobal.footTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-years">'+
|
||||
'<table class="table-condensed">'+
|
||||
this.DPGlobal.headTemplate+
|
||||
this.DPGlobal.contTemplate+
|
||||
this.DPGlobal.footTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-decades">'+
|
||||
'<table class="table-condensed">'+
|
||||
this.DPGlobal.headTemplate+
|
||||
this.DPGlobal.contTemplate+
|
||||
this.DPGlobal.footTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-centuries">'+
|
||||
'<table class="table-condensed">'+
|
||||
this.DPGlobal.headTemplate+
|
||||
this.DPGlobal.contTemplate+
|
||||
this.DPGlobal.footTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
};
|
||||
|
||||
//한국어설정 추가, 기본설정 변경, 오늘버튼,지우기버튼 영역 수정
|
||||
$.fn.datepicker.addKo = function(){
|
||||
|
||||
this.dates['ko'] = {
|
||||
days: ["일","월","화","수","목","금","토"],
|
||||
daysShort: ["일","월","화","수","목","금","토"],
|
||||
daysMin: ["일","월","화","수","목","금","토"],
|
||||
months: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"],
|
||||
monthsShort: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"],
|
||||
today: "오늘",
|
||||
clear: "지우기",
|
||||
titleFormat: "yyyy년 MM"
|
||||
};
|
||||
|
||||
this.defaults.language = 'ko';
|
||||
this.defaults.rtl = false;
|
||||
this.defaults.format = 'yyyy-mm-dd';
|
||||
|
||||
this.defaults.autoclose = true;
|
||||
this.defaults.clearBtn = true;
|
||||
this.defaults.todayBtn = 'linked';
|
||||
this.defaults.keyboardNavigation = false;
|
||||
this.defaults.maxViewMode = 2;
|
||||
this.defaults.todayHighlight = true;
|
||||
this.defaults.weekStart = 0;
|
||||
this.defaults.disableTouchKeyboard = true;
|
||||
this.defaults.enableOnReadonly = false;
|
||||
this.defaults.immediateUpdates = true;
|
||||
this.defaults.zIndexOffset = 1;
|
||||
|
||||
this.DPGlobal.footTemplate = '<tfoot>'+
|
||||
'<tr>'+
|
||||
'<th colspan="7">'+
|
||||
'<button type="button" class="today float-start me-1 border-default rounded-2"></button>'+
|
||||
'<button type="button" class="clear float-start me-1 border-default rounded-2"></button>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'</tfoot>';
|
||||
this.makeTemplate();
|
||||
|
||||
}
|
||||
|
||||
//z-index 변경
|
||||
$.fn.datepicker.prototype.constructor.Constructor.prototype.originalPlace =
|
||||
$.fn.datepicker.prototype.constructor.Constructor.prototype.place;
|
||||
$.fn.datepicker.prototype.constructor.Constructor.prototype.place = function(){
|
||||
|
||||
var r = this.originalPlace();
|
||||
var styleAttr = r.picker.attr('style');
|
||||
var ziStart = styleAttr.substring(styleAttr.indexOf("z-index"));
|
||||
var semicolonIdx = ziStart.indexOf(";");
|
||||
if(semicolonIdx != -1){
|
||||
ziString = ziStart.substring(0,semicolonIdx);
|
||||
} else {
|
||||
ziString = ziStart;
|
||||
}
|
||||
|
||||
if(ziString.indexOf("!important") == -1){
|
||||
var ziValue = ziString.substring(9);
|
||||
var replaceStr = "z-index: " + ziValue + ' !important';
|
||||
r.picker.attr('style', styleAttr.replace(ziString, replaceStr));
|
||||
}
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
$.fn.datepicker.addKo();
|
Loading…
Reference in New Issue