航班信息显示转换

This commit is contained in:
zhouyuejun
2018-11-21 18:55:57 +08:00
parent 526cfe1251
commit 4582b465ee
36 changed files with 862 additions and 401 deletions
+24
View File
@@ -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 '';
}
}