maya-dates

@drewsonne/maya-dates / Exports / DistanceNumber

Class: DistanceNumber

Minimal interface used for equality comparison across calendar components.

Hierarchy

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DistanceNumber(...cycles)

Parameters

Name Type Description
...cycles (number | Wildcard)[] Components in the long count (eg, K’in, Winal, Bak’tun, etc)

Overrides

CommentWrapper.constructor

Defined in

lc/distance-number.ts:19

Properties

comment

comment: Comment

Attached comment.

Inherited from

CommentWrapper.comment

Defined in

comment-wrapper.ts:11


datePattern

datePattern: RegExp

Defined in

lc/distance-number.ts:12


parts

parts: (number | Wildcard)[]

Defined in

lc/distance-number.ts:11


sign

sign: number

Defined in

lc/distance-number.ts:13

Accessors

bakTun

get bakTun(): number | Wildcard

Return the bak’tun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:261

set bakTun(newBakTun): void

Set the bak’tun component of the fullDate

Parameters

Name Type
newBakTun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:253


isNegative

get isNegative(): boolean

Return true if the Long Count is operating as a negative Distance Number.

Returns

boolean

Defined in

lc/distance-number.ts:59

set isNegative(newNegative): void

Set this Long Count as being a negative Distance Number

Parameters

Name Type
newNegative boolean

Returns

void

Defined in

lc/distance-number.ts:75


isPositive

get isPositive(): boolean

Return true if the Long Count is positive.

Returns

boolean

Defined in

lc/distance-number.ts:51

set isPositive(newPositive): void

Set this Long Count as being a Long Count or a positive Distance Number

Parameters

Name Type
newPositive boolean

Returns

void

Defined in

lc/distance-number.ts:67


kAtun

get kAtun(): number | Wildcard

Return the k’atun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:246

set kAtun(newKAtun): void

Set the k’atun component of the fullDate

Parameters

Name Type
newKAtun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:238


kIn

get kIn(): number | Wildcard

Return the k’in component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:201

set kIn(newKIn): void

Set the k’in component of the fullDate

Parameters

Name Type
newKIn number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:193


kalabtun

get kalabtun(): number | Wildcard

Return the kalabtun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:291

set kalabtun(newBakTun): void

Set the kalabtun component of the fullDate

Parameters

Name Type
newBakTun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:283


kinchiltun

get kinchiltun(): number | Wildcard

Return the kinchiltun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:306

set kinchiltun(newBakTun): void

Set the kinchiltun component of the fullDate

Parameters

Name Type
newBakTun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:298


piktun

get piktun(): number | Wildcard

Return the piktun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:276

set piktun(newBakTun): void

Set the piktun component of the fullDate

Parameters

Name Type
newBakTun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:268


sigParts

get sigParts(): (number | Wildcard)[]

Only digits in the LC with significant digits

Returns

(number | Wildcard)[]

Defined in

lc/distance-number.ts:119


tun

get tun(): number | Wildcard

Return the tun component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:231

set tun(newTun): void

Set the tun component of the fullDate

Parameters

Name Type
newTun number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:223


winal

get winal(): number | Wildcard

Return the winal component of the fullDate

Returns

number | Wildcard

Defined in

lc/distance-number.ts:216

set winal(newWinal): void

Set the winal component of the fullDate

Parameters

Name Type
newWinal number | Wildcard

Returns

void

Defined in

lc/distance-number.ts:208

Methods

appendComment

appendComment(comment): any

Append additional text to the current comment.

Parameters

Name Type
comment string | Comment

Returns

any

Inherited from

CommentWrapper.appendComment

Defined in

comment-wrapper.ts:34


clone

clone(): DistanceNumber

Create a copy object of this long count fullDate

Returns

DistanceNumber

Defined in

lc/distance-number.ts:135


commentIsEqual

commentIsEqual(otherCommentWrapper): boolean

Compare this wrapper’s comment against another wrapper.

Parameters

Name Type
otherCommentWrapper CommentWrapper

Returns

boolean

Inherited from

CommentWrapper.commentIsEqual

Defined in

comment-wrapper.ts:52


equal

equal(other): boolean

Given two long count dates, check if they are equal

Parameters

Name Type
other IPart

Returns

boolean

Implementation of

IPart.equal

Defined in

lc/distance-number.ts:84


equalWithComment

equalWithComment(otherCommentWrapper): boolean

Check equality including the associated comment.

Parameters

Name Type
otherCommentWrapper IPart

Returns

boolean

Inherited from

CommentWrapper.equalWithComment

Defined in

comment-wrapper.ts:59


exactlyEqual

exactlyEqual(other): boolean

Given two long count dates, check if they are exactly equal

Parameters

Name Type
other DistanceNumber

Returns

boolean

Defined in

lc/distance-number.ts:106


getDateSections

getDateSections(index): number | Wildcard

Get specific column in Long Count fullDate

Parameters

Name Type
index number

Returns

number | Wildcard

Defined in

lc/distance-number.ts:144


getPosition

getPosition(): number

Count the number of days since 0.0.0.0.0 for this LC.

Returns

number

Defined in

lc/distance-number.ts:331


gt

gt(newLongCount): boolean

Compare is this LC is less than the supplied LC.

Parameters

Name Type
newLongCount DistanceNumber

Returns

boolean

Defined in

lc/distance-number.ts:186


isPartial

isPartial(): boolean

Returns true if any of the positions in the Long Count have been assigned a {Wildcard} object.

Returns

boolean

Defined in

lc/distance-number.ts:323


isValid

isValid(): boolean

Ensure the fullDate has only numbers and wildcards separated by points.

Returns

boolean

Defined in

lc/distance-number.ts:314


lt

lt(newLongCount): boolean

Compare if this LC is greater than the supplied LC.

Parameters

Name Type
newLongCount DistanceNumber

Returns

boolean

Defined in

lc/distance-number.ts:177


map

map(fn): any[]

Pass the map down to the parts

Parameters

Name Type
fn (lcPart: number | Wildcard, lcPartIndex: number) => any

Returns

any[]

Defined in

lc/distance-number.ts:168


minus

minus(newLc): LongcountSubtraction

Return the difference between this Long Count and the supplied

Parameters

Name Type
newLc DistanceNumber

Returns

LongcountSubtraction

Defined in

lc/distance-number.ts:380


normalise

normalise(): DistanceNumber

Make sure the elements of the Long Count do not exceed

Returns

DistanceNumber

Defined in

lc/distance-number.ts:391


plus

plus(newLc): LongcountAddition

Return the sum of this Long Count and the supplied

Parameters

Name Type
newLc DistanceNumber

Returns

LongcountAddition

Defined in

lc/distance-number.ts:368


setComment

setComment(comment): any

Replace the current comment.

Parameters

Name Type
comment string | Comment

Returns

any

Inherited from

CommentWrapper.setComment

Defined in

comment-wrapper.ts:20


setDateSections

setDateSections(index, newValue): DistanceNumber

Set specific column in Long Count fullDate

Parameters

Name Type
index number
newValue number | Wildcard

Returns

DistanceNumber

Defined in

lc/distance-number.ts:158


toString

toString(): string

Convert the LongCount to a string and pad the sections of the fullDate

Returns

string

Defined in

lc/distance-number.ts:421