datepicker 수정

main
이범준 8 months ago
parent 7f85eb96ed
commit 9d50a7c092

@ -32,7 +32,7 @@
<script src="<c:url value="/resources/js/fims/menu-support-fims.js?${ver}"/>"></script> <script src="<c:url value="/resources/js/fims/menu-support-fims.js?${ver}"/>"></script>
<!-- 데이트픽커 --> <!-- 데이트픽커 -->
<script src="<c:url value="/resources/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js?${ver}"/>"></script> <script src="<c:url value="/resources/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/fims/bootstrap-datepicker-support.js?${ver}"/>"></script>
<!-- 전체화면 비활성화 --> <!-- 전체화면 비활성화 -->
<script src="<c:url value="/resources/sneat/libs/block-ui/block-ui.js?${ver}"/>"></script> <script src="<c:url value="/resources/sneat/libs/block-ui/block-ui.js?${ver}"/>"></script>

@ -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();

@ -770,6 +770,23 @@
zIndex: zIndex zIndex: zIndex
}); });
} }
//
var styleAttr = this.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';
this.picker.attr('style', styleAttr.replace(ziString, replaceStr));
}
return this; return this;
}, },
@ -992,9 +1009,9 @@
startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
todaytxt = dates[this.o.language].today || dates['en'].today || '', todaytxt = dates[this.o.language].today || dates['ko'].today || '',
cleartxt = dates[this.o.language].clear || dates['en'].clear || '', cleartxt = dates[this.o.language].clear || dates['ko'].clear || '',
titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat, titleFormat = dates[this.o.language].titleFormat || dates['ko'].titleFormat,
todayDate = UTCToday(), todayDate = UTCToday(),
titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate), titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate),
tooltip, tooltip,
@ -1084,7 +1101,7 @@
} }
this.picker.find('.datepicker-days tbody').html(html.join('')); this.picker.find('.datepicker-days tbody').html(html.join(''));
var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months'; var monthsTitle = dates[this.o.language].monthsTitle || dates['ko'].monthsTitle || 'Months';
var months = this.picker.find('.datepicker-months') var months = this.picker.find('.datepicker-months')
.find('.datepicker-switch') .find('.datepicker-switch')
.text(this.o.maxViewMode < 2 ? monthsTitle : year) .text(this.o.maxViewMode < 2 ? monthsTitle : year)
@ -1704,43 +1721,44 @@
$.fn.datepicker = datepickerPlugin; $.fn.datepicker = datepickerPlugin;
var defaults = $.fn.datepicker.defaults = { var defaults = $.fn.datepicker.defaults = {
language: 'ko',
rtl: false,
autoclose: true,
format: 'yyyy-mm-dd',
clearBtn: true,
todayBtn: 'linked',
keyboardNavigation: false,
minViewMode: 0,
maxViewMode: 2,
weekStart: 0,
todayHighlight: true,
disableTouchKeyboard: true,
enableOnReadonly: false,
immediateUpdates: true,
zIndexOffset: 1,
assumeNearbyYear: false, assumeNearbyYear: false,
autoclose: false,
beforeShowDay: $.noop, beforeShowDay: $.noop,
beforeShowMonth: $.noop, beforeShowMonth: $.noop,
beforeShowYear: $.noop, beforeShowYear: $.noop,
beforeShowDecade: $.noop, beforeShowDecade: $.noop,
beforeShowCentury: $.noop, beforeShowCentury: $.noop,
calendarWeeks: false, calendarWeeks: false,
clearBtn: false,
toggleActive: false, toggleActive: false,
daysOfWeekDisabled: [], daysOfWeekDisabled: [],
daysOfWeekHighlighted: [], daysOfWeekHighlighted: [],
datesDisabled: [], datesDisabled: [],
endDate: Infinity, endDate: Infinity,
forceParse: true, forceParse: true,
format: 'mm/dd/yyyy',
keepEmptyValues: false, keepEmptyValues: false,
keyboardNavigation: true,
language: 'en',
minViewMode: 0,
maxViewMode: 4,
multidate: false, multidate: false,
multidateSeparator: ',', multidateSeparator: ',',
orientation: "auto", orientation: "auto",
rtl: false,
startDate: -Infinity, startDate: -Infinity,
startView: 0, startView: 0,
todayBtn: false,
todayHighlight: false,
updateViewDate: true, updateViewDate: true,
weekStart: 0,
disableTouchKeyboard: false,
enableOnReadonly: true,
showOnFocus: true, showOnFocus: true,
zIndexOffset: 10,
container: 'body', container: 'body',
immediateUpdates: false,
title: '', title: '',
templates: { templates: {
leftArrow: '&#x00AB;', leftArrow: '&#x00AB;',
@ -1755,15 +1773,15 @@
]; ];
$.fn.datepicker.Constructor = Datepicker; $.fn.datepicker.Constructor = Datepicker;
var dates = $.fn.datepicker.dates = { var dates = $.fn.datepicker.dates = {
en: { ko: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], days: ["일","월","화","수","목","금","토"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], daysShort: ["일","월","화","수","목","금","토"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], daysMin: ["일","월","화","수","목","금","토"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], months: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], monthsShort: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"],
today: "Today", today: "오늘",
clear: "Clear", clear: "지우기",
titleFormat: "MM yyyy" titleFormat: "yyyy년 MM"
} }
}; };
@ -1979,10 +1997,10 @@
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
footTemplate: '<tfoot>'+ footTemplate: '<tfoot>'+
'<tr>'+ '<tr>'+
'<th colspan="7" class="today"></th>'+ '<th colspan="7">'+
'</tr>'+ '<button type="button" class="today float-start me-1 border-default rounded-2"></button>'+
'<tr>'+ '<button type="button" class="clear float-start me-1 border-default rounded-2"></button>'+
'<th colspan="7" class="clear"></th>'+ '</th>'+
'</tr>'+ '</tr>'+
'</tfoot>' '</tfoot>'
}; };

Loading…
Cancel
Save