消息联调登机门和值机柜台修改
This commit is contained in:
@@ -234,9 +234,26 @@ onmessage = function (dynamicData) {
|
||||
}
|
||||
},
|
||||
'GCTM': function gctmFormatter(flight) {
|
||||
function add0(m) {
|
||||
return m < 10 ? '0' + m : m
|
||||
}
|
||||
if (flight['GTDT']) {
|
||||
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
|
||||
return timeFormatter(flight['GTDT'][0]['GCTM']);
|
||||
let gtdt = flight['GTDT'];
|
||||
let gctmArray = [];
|
||||
gtdt.forEach(element => {
|
||||
if (element['GCTM']) {
|
||||
let gctmTime = new Date(dateFormatter(element['GCTM'])).getTime();
|
||||
gctmArray.push(gctmTime)
|
||||
}
|
||||
});
|
||||
|
||||
if (gctmArray.length > 0) {
|
||||
let laterTime = Math.max.apply(null, gctmArray);
|
||||
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else if (Object.prototype.toString.call(flight['GTDT']) === '[object Object]') {
|
||||
return timeFormatter(flight['GTDT']['GCTM']);
|
||||
} else {
|
||||
@@ -352,9 +369,26 @@ onmessage = function (dynamicData) {
|
||||
}
|
||||
},
|
||||
'CCTM': function cctmFormatter(flight) {
|
||||
function add0(m) {
|
||||
return m < 10 ? '0' + m : m
|
||||
}
|
||||
if (flight['CKDT']) {
|
||||
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
|
||||
return timeFormatter(flight['CKDT'][0]['CCTM']);
|
||||
let ckdt = flight['CKDT'];
|
||||
let cctmArray = [];
|
||||
ckdt.forEach(element => {
|
||||
if (element['CCTM']) {
|
||||
let cctmTime = new Date(dateFormatter(element['CCTM'])).getTime();
|
||||
cctmArray.push(cctmTime)
|
||||
}
|
||||
});
|
||||
|
||||
if (cctmArray.length > 0) {
|
||||
let laterTime = Math.max.apply(null, cctmArray);
|
||||
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
|
||||
return timeFormatter(flight['CKDT']['CCTM']);
|
||||
} else {
|
||||
@@ -365,11 +399,28 @@ onmessage = function (dynamicData) {
|
||||
}
|
||||
},
|
||||
'COTM': function cotmFormatter(flight) {
|
||||
function add0(m) {
|
||||
return m < 10 ? '0' + m : m
|
||||
}
|
||||
if (flight['CKDT']) {
|
||||
if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) {
|
||||
return timeFormatter(flight['CKDT'][0]['COTM']);
|
||||
let ckdt = flight['CKDT'];
|
||||
let cotmArray = [];
|
||||
ckdt.forEach(element => {
|
||||
if (element['COTM']) {
|
||||
let cctmTime = new Date(dateFormatter(element['COTM'])).getTime();
|
||||
cotmArray.push(cctmTime)
|
||||
}
|
||||
});
|
||||
|
||||
if (cotmArray.length > 0) {
|
||||
let laterTime = Math.min.apply(null, cotmArray);
|
||||
return add0(new Date(laterTime).getHours()) + ':' + add0(new Date(laterTime).getMinutes())
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else if (Object.prototype.toString.call(flight['CKDT']) === '[object Object]') {
|
||||
return timeFormatter(flight['CKDT']['COTM']);
|
||||
return timeFormatter(flight['CKDT']['CCTM']);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user