航班信息显示转换
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 上轮档时间显示转换
|
||||
*/
|
||||
import timeFormatter from './time-formatter';
|
||||
|
||||
export default function (flight) {
|
||||
if (flight['CHOT']) {
|
||||
if (Array.isArray(flight['CHOT']) && flight['CHOT'].length > 0) {
|
||||
for (let i = 0; i < flight['CHOT'].length; i++) {
|
||||
if (flight['CHOT'][i]['CHID'] === 'ON') {
|
||||
return timeFormatter(flight['CHOT'][i]['CHTM']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (flight['CHOT']['CHID'] === 'ON') {
|
||||
return timeFormatter(flight['CHOT']['CHTM']);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user