diff --git a/A32NX/html_ui/Pages/VCockpit/Instruments/Airliners/A320_Neo/CDU/A320_Neo_CDU_IdentPage.js b/A32NX/html_ui/Pages/VCockpit/Instruments/Airliners/A320_Neo/CDU/A320_Neo_CDU_IdentPage.js
index 046d43a1d08..dade1c39e90 100644
--- a/A32NX/html_ui/Pages/VCockpit/Instruments/Airliners/A320_Neo/CDU/A320_Neo_CDU_IdentPage.js
+++ b/A32NX/html_ui/Pages/VCockpit/Instruments/Airliners/A320_Neo/CDU/A320_Neo_CDU_IdentPage.js
@@ -16,6 +16,73 @@
* along with this program. If not, see .
*/
+const months = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
+const monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+
+function findNewMonthIndex(index) {
+ if (index === 0) {
+ return 11;
+ } else {
+ return index - 1;
+ }
+}
+
+function lessThan10(num) {
+ if (num < 10) {
+ return `0${num}`;
+ } else {
+ return num;
+ }
+}
+
+function calculateActiveDate(date) {
+ if (date.length === 13) {
+ const startMonth = date.slice(0, 3);
+ const startDay = date.slice(3, 5);
+
+ const endMonth = date.slice(5, 8);
+ const endDay = date.slice(8, 10);
+
+ return `${startDay}${startMonth}-${endDay}${endMonth}`;
+ } else {
+ return date;
+ }
+}
+
+function calculateSecDate(date) {
+ if (date.length === 13) {
+ const primStartMonth = date.slice(0, 3);
+ const primStartDay = date.slice(3, 5);
+
+ const primStartMonthIndex = months.findIndex((item) => item === primStartMonth);
+
+ if (primStartMonthIndex === -1) {
+ return "ERR";
+ }
+
+ let newEndMonth = primStartMonth;
+ let newEndDay = primStartDay - 1;
+
+ let newStartDay = newEndDay - 27;
+ let newStartMonth = primStartMonth;
+
+ if (newEndDay === 0) {
+ newEndMonth = months[findNewMonthIndex(primStartMonthIndex)];
+ newEndDay = monthLength[findNewMonthIndex(primStartMonthIndex)];
+ }
+
+ if (newStartDay <= 0) {
+ newStartMonth = months[findNewMonthIndex(primStartMonthIndex)];
+ newStartDay = monthLength[findNewMonthIndex(primStartMonthIndex)] + newStartDay;
+ }
+
+ return `${lessThan10(newStartDay)}${newStartMonth}-${lessThan10(newEndDay)}${newEndMonth}`;
+ } else {
+ return "ERR";
+ }
+
+}
+
class CDUIdentPage {
static ShowPage(mcdu) {
const date = mcdu.getNavDataDateRange();
@@ -23,19 +90,19 @@ class CDUIdentPage {
mcdu.page.Current = mcdu.page.IdentPage;
mcdu.activeSystem = 'FMGC';
mcdu.setTemplate([
- ["A320-200"],
+ ["A320-200"],//This aircraft code is correct and does not include the engine type.
["\xa0ENG"],
- ["LEAP 1A-26[color]green"],
+ ["LEAP-1A26[color]green"],
["\xa0ACTIVE NAV DATA BASE"],
- ["\xa0" + (date.length === 13 ? date[3] + date[4] + date[0] + date[1] + date[2] + "-" + date[8] + date[9] + date[5] + date[6] + date[7] : date) + "[color]cyan", "AIRAC[color]green"],
+ ["\xa0" + calculateActiveDate(date) + "[color]cyan", "AIRAC[color]green"],
["\xa0SECOND NAV DATA BASE"],
- ["{small}{04MAY-04JUL{end}[color]cyan"],
- ["", "STORED"],
- ["", "{green}10{end}{small}RTES\xa0{end}{green}10{end}{small}RWYS{end}"],
- ["CHG CODE", "[b-text]{big}{green}20{end}{end}WPTS\xa0{big}{green}20{end}{end}NAVS"],
- ["{small}[ ]{end}[color]cyan", "DELETE ALL}[color]cyan"],
+ ["{small}{" + calculateSecDate(date) + "{end}[color]inop"],
+ ["", ""],
+ ["", ""],
+ ["CHG CODE", ""],
+ ["{small}[ ]{end}[color]inop", ""],
["IDLE/PERF", "SOFTWARE"],
- ["+0.0/+0.0[color]green", "STATUS/XLOAD>"]
+ ["+0.0/+0.0[color]green", "STATUS/XLOAD>[color]inop"]
]);
}
}