Index: arms/html/fullDataSheet/content-container.html =================================================================== diff -u -r3816e22fa2a224bd4d0d42d20e41af0f64ffd94a -rd33ec407eadefd31fd9fa94f2c94408a0acead23 --- arms/html/fullDataSheet/content-container.html (.../content-container.html) (revision 3816e22fa2a224bd4d0d42d20e41af0f64ffd94a) +++ arms/html/fullDataSheet/content-container.html (.../content-container.html) (revision d33ec407eadefd31fd9fa94f2c94408a0acead23) @@ -76,7 +76,7 @@
+ style="overflow: auto; min-height: 150px; margin-bottom: 15px">
@@ -165,7 +165,7 @@
+ style="margin-bottom: 15px; min-height: 150px">

"); + console.log("[fullDataSheet :: makePdServiceSelectBox] :: pdServiceListData => "); console.table(pdServiceListData); } } @@ -183,19 +186,18 @@ for (var k in data.response) { var obj = data.response[k]; pdServiceVersionIds.push(obj.c_id); - versionListData.push(obj); + versionListData.push({"c_id" : obj.c_id, "c_title" : obj.c_title, + "start_date" : obj.c_pds_version_start_date, + "end_date" : obj.c_pds_version_end_date}); var newOption = new Option(obj.c_title, obj.c_id, true, false); $(".multiple-select").append(newOption); } var versionTag = $(".multiple-select").val(); - console.log("[ analysisScope :: bind_VersionData_By_PdService ] :: versionTag"); - - console.log(pdServiceVersionIds); selectedVersionId = pdServiceVersionIds.join(","); - console.log("bind_VersionData_By_PdService :: selectedVersionId"); - console.log(selectedVersionId); + + // 시작일 종료일 세팅(datetimepicker) + setEdgeDateRange(versionListData); - if (data.length > 0) { console.log("display 재설정."); } @@ -213,13 +215,14 @@ //버전 선택시 셀렉트 박스 이니시에이터 $(".multiple-select").multipleSelect({ filter: true, + // selectBox 닫혔을 때 onClose: function() { console.log("onOpen event fire!\n"); var checked = $("#checkbox1").is(":checked"); var endPointUrl = ""; var versionTag = $(".multiple-select").val(); - console.log("[ analysisScope :: makeVersionMultiSelectBox ] :: versionTag"); + console.log("[ fullDataSheet :: makeVersionMultiSelectBox ] :: versionTag"); console.log(versionTag); selectedVersionId = versionTag.join(","); @@ -228,19 +231,23 @@ return; } + let filteredVersionData = versionListData.filter(item => versionTag.includes(item.c_id.toString())); + // 시작일 종료일 세팅(datetimepicker) + setEdgeDateRange(filteredVersionData); + $(".ms-parent").css("z-index", 1000); }, + // selectBox 열렸을 때 onOpen: function() { - console.log("open event"); $(".ms-parent").css("z-index", 9999); } }); } //////////////////////////////////////// -// 검색날짜 기간 설정 세팅 +// 기간 설정 세팅 //////////////////////////////////////// -function datetTimePicker() { +function dateTimePicker() { $('#date_timepicker_start').datetimepicker({ format: 'Y-m-d', // 날짜 및 시간 형식 지정 formatDate: 'Y/m/d', @@ -271,4 +278,36 @@ }); } }); +} + + +//////////////////////////////////////// +// 선택한 버전 - min,max 날짜 세팅 +//////////////////////////////////////// +function setEdgeDateRange(versionData) { + + if (!versionData || Object.keys(versionData).length === 0) { + console.log("[ fullDataSheet :: setEdgeDateRange ] :: versionData 가 없습니다."); + return false; + } + + let minMaxDate = versionData.reduce((acc, curr) => { + const startDate = new Date(curr.start_date); + const endDate = new Date(curr.end_date); + + if (!acc.min || startDate < acc.min) { + acc.min = startDate; + } + + if (!acc.max || endDate > acc.max) { + acc.max = endDate; + } + + return acc; + }, { min: null, max: null }); + console.log("[ fullDataSheet :: setEdgeDateRange ] :: " + + "minMaxDate.min => " + minMaxDate.min+ ", minMaxDate.max => " +minMaxDate.max); + + $('#date_timepicker_start').datetimepicker('setOptions', { value: minMaxDate.min }); + $('#date_timepicker_end').datetimepicker('setOptions', { value: minMaxDate.max }); } \ No newline at end of file