airac-cc (AIRAC cycle calculator)
This module can be used to calculate Aeronautical Information Regulation And Control (AIRAC) cycle identifiers and effectivity dates as defined by the International Civil Aviation Organization (ICAO). A list of current AIRAC cycle effectivity dates can be found here.
The code of this module is based on a similar Java library written by Johannes Kohnen.
Usage
const airac = ;let cycle;try cycle = airacCycle; console; console; catch error if error instanceof airacInvalidCycleIdentifierError // ... cycle = airacCycle;console;console;console;
Note: when using the fromIdentifier
method, this module will only consider AIRAC cycle identifiers between January 1st 1980 and December 31st 2079. Therefore, cycle 7501 will be considred to be the first cycle of 2075, not 1975! If you want to calculate effectifity dates outside of this range, use the fromDate
method.
This module comes with TypeScript definitions. The TypeScript version of the code above:
;;try catch error cycle = Cycle.fromDatenew Date;console.logcycle.identifier;console.logcycle.effectiveStart;console.logcycle.effectiveEnd;
CLI
The AIRAC cycle calculator also comes with a CLI. Install it globally via
npm install -g airac-cc
This will install the command airac-cc
globally on your system.
Print out the AIRAC cycle identifier and the corresponding effectivity dates of the currently effective AIRAC cycle to the console:
airac-cc
Print out the AIRAC cycle identifier and the corresponding effectivity dates for a specific AIRAC cycle (identified by the given cycle identifier):
airac-cc -i 1909
Note: when using the -i
option, this module will only consider AIRAC cycle identifiers between January 1st 1980 and December 31st 2079. Therefore, cycle 7501 will be considred to be the first cycle of 2075, not 1975! If you want to calculate effectifity dates outside of this range, use the -d
option (see below).
Print out the AIRAC cycle identifier and the corresponding effectivity dates for the cycle that's effective on a specific date (specify the date in ISO format):
airac-cc -d 2019-08-15
Print the help for the module:
airac-cc -h