Browse Source

운항 스케줄 비행중 시간체크 이슈 수정

ctrlDraw
김장현 2 years ago
parent
commit
af44093e3a
  1. 40
      src/components/basis/flight/schedule/FlightScheduleGrid.js

40
src/components/basis/flight/schedule/FlightScheduleGrid.js

@ -139,6 +139,7 @@ function FlightScheduleGrid() {
// 현재날짜 // 현재날짜
const currDay = Number(moment().format('YYYYMMDD')); const currDay = Number(moment().format('YYYYMMDD'));
const currDateTime = moment();
// 데이터 시작날짜 // 데이터 시작날짜
// const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD')); // const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD'));
@ -146,7 +147,15 @@ function FlightScheduleGrid() {
const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD')); const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD'));
const itemStartTime = moment(row.schFltStDt).format('HHmm'); const itemStartTime = moment(row.schFltStDt).format('HHmm');
const itemEndTime = moment(row.schFltEndDt).format('HHmm'); const itemEndTime = moment(row.schFltEndDt);
const diffTime =
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60 >
-0
? moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60
: Math.ceil(
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() %
60
);
// 현재날짜 - 종료날짜 // 현재날짜 - 종료날짜
if (currDay - itemEndDay > 0) { if (currDay - itemEndDay > 0) {
@ -162,7 +171,7 @@ function FlightScheduleGrid() {
return false; return false;
} }
if (row.statusCd === 'F') { if (row.statusCd === 'F') {
if (currTime - itemEndTime >= 10 && currTime - itemEndTime <= 19) { if (diffTime >= 10 && diffTime <= 19) {
return true; return true;
} }
return false; return false;
@ -182,6 +191,7 @@ function FlightScheduleGrid() {
.substring(0, 4); .substring(0, 4);
// 현재날짜 // 현재날짜
const currDay = Number(moment().format('YYYYMMDD')); const currDay = Number(moment().format('YYYYMMDD'));
const currDateTime = moment();
// 데이터 시작날짜 // 데이터 시작날짜
// const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD')); // const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD'));
@ -189,7 +199,15 @@ function FlightScheduleGrid() {
const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD')); const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD'));
const itemStartTime = moment(row.schFltStDt).format('HHmm'); const itemStartTime = moment(row.schFltStDt).format('HHmm');
const itemEndTime = moment(row.schFltEndDt).format('HHmm'); const itemEndTime = moment(row.schFltEndDt);
const diffTime =
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60 >
-0
? moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60
: Math.ceil(
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() %
60
);
// 현재날짜 - 종료날짜 // 현재날짜 - 종료날짜
if (currDay - itemEndDay > 0) { if (currDay - itemEndDay > 0) {
@ -207,7 +225,7 @@ function FlightScheduleGrid() {
} }
// 비행중 체크 // 비행중 체크
if (row.statusCd === 'F') { if (row.statusCd === 'F') {
if (currTime - itemEndTime >= 20 && currTime - itemEndTime <= 29) { if (diffTime >= 20 && diffTime <= 29) {
return true; return true;
} }
return false; return false;
@ -227,14 +245,22 @@ function FlightScheduleGrid() {
.substring(0, 4); .substring(0, 4);
// 현재날짜 // 현재날짜
const currDay = Number(moment().format('YYYYMMDD')); const currDay = Number(moment().format('YYYYMMDD'));
const currDateTime = moment();
// 데이터 시작날짜 // 데이터 시작날짜
// const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD')); // const itemStartDay = Number(moment(row.schFltStDt).format('YYYYMMDD'));
// 데이터 종료날짜 // 데이터 종료날짜
const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD')); const itemEndDay = Number(moment(row.schFltEndDt).format('YYYYMMDD'));
const itemStartTime = moment(row.schFltStDt).format('HHmm'); const itemStartTime = moment(row.schFltStDt).format('HHmm');
const itemEndTime = moment(row.schFltEndDt).format('HHmm'); const itemEndTime = moment(row.schFltEndDt);
const diffTime =
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60 >
-0
? moment.duration(currDateTime.diff(itemEndTime)).asMinutes() % 60
: Math.ceil(
moment.duration(currDateTime.diff(itemEndTime)).asMinutes() %
60
);
// 현재날짜 - 종료날짜 // 현재날짜 - 종료날짜
if (currDay - itemEndDay > 0) { if (currDay - itemEndDay > 0) {
@ -252,7 +278,7 @@ function FlightScheduleGrid() {
if (currDay - itemEndDay < 0) { if (currDay - itemEndDay < 0) {
return false; return false;
} }
if (currTime - itemEndTime > 30) { if (diffTime > 30) {
return true; return true;
} }
return false; return false;

Loading…
Cancel
Save