Class: AiracCycleFormatter
A utility class for creating AIRAC cycle formatters.
Methods
create
▸ create(format
): AiracCycleFormatterFunction
Creates a new AIRAC cycle formatter.
Parameters
Name | Type | Description |
---|---|---|
format | string | The format to use, with the following possible items to be replaced: - {CC} : is replaced with the 2-digit cycle number e.g. 01, - {YYCC} : is replaced with the 4-digit cycle number, including the effective year and the cycle number e.g. 2401, - {eff(dateTimeFormat)} : is replaced by the effective date, formatted by DateTimeFormatter with the given dateTimeFormat , - {exp(dateTimeFormat)} : is replaced by the expiration date, formatted by DateTimeFormatter with the given dateTimeFormat , - {expMinus(dateTimeFormat)} : is replaced by the expiration date minus one second (i.e. 1 second before midnight the previous day), formatted by DateTimeFormatter with the given dateTimeFormat . Note: Some avionics use exp (overlapping dates) while others use expMinus (non-overlapping dates) for the expiration dates.\ Make sure to check what yours should do. |
Returns
The formatter function.
Example
The format `{YYCC} {eff({dd}-{MON})}/{exp({dd}-{MON})}` gives "2309 07-SEP/05-OCT" for AIRAC cycle 2309.
Example
The format `{YYCC} {eff({dd}-{MON})}/{expMinus({dd}-{MON})}` gives "2309 07-SEP/04-OCT" for AIRAC cycle 2309.
Throws
If the format is invalid, an exception will be thrown.
Defined in
src/sdk/graphics/text/AiracCycleFormatter.ts:40