Skip to main content

Class: AiracUtils

Defined in: src/sdk/navigation/AiracUtils.ts:33

Utilities for AIRAC cycles.

Constructors​

Constructor​

new AiracUtils(): AiracUtils

Returns​

AiracUtils

Properties​

CYCLE_DURATION​

readonly static CYCLE_DURATION: number

Defined in: src/sdk/navigation/AiracUtils.ts:37

Duration of an AIRAC cycle (28 days) in milliseconds.

Methods​

getCurrentCycle()​

static getCurrentCycle(date, out?): AiracCycle

Defined in: src/sdk/navigation/AiracUtils.ts:105

Gets the current cycle for a given date.

Parameters​

ParameterTypeDescription
dateDateThe date to determine the current cycle for.
out?Partial<AiracCycle>An optional object to write the result to. If not specified a new object will be used.

Returns​

AiracCycle

The AIRAC cycle information.


getCycleNumber()​

static getCycleNumber(effectiveTimestamp): number

Defined in: src/sdk/navigation/AiracUtils.ts:91

Gets the AIRAC cycle number in the effective year, given the effective date.

Parameters​

ParameterTypeDescription
effectiveTimestampnumberThe effective timestamp, in milliseconds since the UNIX epoch, to determine the cycle number for.

Returns​

number

The cycle number.


getOffsetCycle()​

static getOffsetCycle(baseCycle, offset, out?): AiracCycle

Defined in: src/sdk/navigation/AiracUtils.ts:79

Gets a cycle offset from another cycle in increments of 28-days (the length of an AIRAC cycle).

Parameters​

ParameterTypeDescription
baseCycleAiracCycleThe base cycle to offset from.
offsetnumberThe offset in number of cycles (i.e. 28-day increments).
out?Partial<AiracCycle>An optional object to write the result to. If not specified a new object will be used.

Returns​

AiracCycle

The AIRAC cycle information.


parseFacilitiesCycle()​

static parseFacilitiesCycle(facilitiesDateRange, out?): AiracCycle | undefined

Defined in: src/sdk/navigation/AiracUtils.ts:49

Parses the MSFS facility database effective dates into an AIRAC cycle.

Parameters​

ParameterTypeDescription
facilitiesDateRangestringThe MSFS facilities date range from the game var FLIGHT NAVDATA DATE RANGE.
out?Partial<AiracCycle>An optional object to write the result to. If not specified a new object will be used.

Returns​

AiracCycle | undefined

The AIRAC cycle information for the MSFS facility database, or undefined if an error occurs.