@drewsonne/maya-dates / Exports / LongCount
Long Count cycle
↳ LongCount
• new LongCount(...cycles
)
Name | Type | Description |
---|---|---|
...cycles |
(number | Wildcard )[] |
Components in the long count (eg, K’in, Winal, Bak’tun, etc) |
• comment: Comment
Attached comment.
• Private
correlationConstant: CorrelationConstant
• datePattern: RegExp
• parts: (number
| Wildcard
)[]
• sign: number
• get
bakTun(): number
| Wildcard
Return the bak’tun component of the fullDate
number
| Wildcard
DistanceNumber.bakTun
• set
bakTun(newBakTun
): void
Set the bak’tun component of the fullDate
Name | Type |
---|---|
newBakTun |
number | Wildcard |
void
DistanceNumber.bakTun
• get
gregorian(): GregorianCalendarDate
Return a Gregorian representation of this long count date, offset by the correlation constant.
• get
isNegative(): boolean
Return true if the Long Count is operating as a negative Distance Number.
boolean
DistanceNumber.isNegative
• set
isNegative(newNegative
): void
Set this Long Count as being a negative Distance Number
Name | Type |
---|---|
newNegative |
boolean |
void
DistanceNumber.isNegative
• get
isPositive(): boolean
Return true if the Long Count is positive.
boolean
DistanceNumber.isPositive
• set
isPositive(newPositive
): void
Set this Long Count as being a Long Count or a positive Distance Number
Name | Type |
---|---|
newPositive |
boolean |
void
DistanceNumber.isPositive
• get
julian(): JulianCalendarDate
Return a Julian representation of this long count date, offset by the correlation constant.
• get
julianDay(): number
Return a representation of this Long Count in Julian Days.
number
• get
kAtun(): number
| Wildcard
Return the k’atun component of the fullDate
number
| Wildcard
DistanceNumber.kAtun
• set
kAtun(newKAtun
): void
Set the k’atun component of the fullDate
Name | Type |
---|---|
newKAtun |
number | Wildcard |
void
DistanceNumber.kAtun
• get
kIn(): number
| Wildcard
Return the k’in component of the fullDate
number
| Wildcard
DistanceNumber.kIn
• set
kIn(newKIn
): void
Set the k’in component of the fullDate
Name | Type |
---|---|
newKIn |
number | Wildcard |
void
DistanceNumber.kIn
• get
kalabtun(): number
| Wildcard
Return the kalabtun component of the fullDate
number
| Wildcard
DistanceNumber.kalabtun
• set
kalabtun(newBakTun
): void
Set the kalabtun component of the fullDate
Name | Type |
---|---|
newBakTun |
number | Wildcard |
void
DistanceNumber.kalabtun
• get
kinchiltun(): number
| Wildcard
Return the kinchiltun component of the fullDate
number
| Wildcard
DistanceNumber.kinchiltun
• set
kinchiltun(newBakTun
): void
Set the kinchiltun component of the fullDate
Name | Type |
---|---|
newBakTun |
number | Wildcard |
void
DistanceNumber.kinchiltun
• get
lordOfNight(): LordOfTheNight
• get
piktun(): number
| Wildcard
Return the piktun component of the fullDate
number
| Wildcard
DistanceNumber.piktun
• set
piktun(newBakTun
): void
Set the piktun component of the fullDate
Name | Type |
---|---|
newBakTun |
number | Wildcard |
void
DistanceNumber.piktun
• get
sigParts(): (number
| Wildcard
)[]
Only digits in the LC with significant digits
(number
| Wildcard
)[]
DistanceNumber.sigParts
• get
tun(): number
| Wildcard
Return the tun component of the fullDate
number
| Wildcard
DistanceNumber.tun
• set
tun(newTun
): void
Set the tun component of the fullDate
Name | Type |
---|---|
newTun |
number | Wildcard |
void
DistanceNumber.tun
• get
winal(): number
| Wildcard
Return the winal component of the fullDate
number
| Wildcard
DistanceNumber.winal
• set
winal(newWinal
): void
Set the winal component of the fullDate
Name | Type |
---|---|
newWinal |
number | Wildcard |
void
DistanceNumber.winal
▸ appendComment(comment
): any
Append additional text to the current comment.
Name | Type |
---|---|
comment |
string | Comment |
any
▸ asDistanceNumber(): DistanceNumber
Return this Long Count as a Distance Number
▸ buildCalendarRound(): CalendarRound
▸ buildFullDate(): FullDate
▸ clone(): LongCount
Create a copy object of this long count fullDate
▸ commentIsEqual(otherCommentWrapper
): boolean
Compare this wrapper’s comment against another wrapper.
Name | Type |
---|---|
otherCommentWrapper |
CommentWrapper |
boolean
▸ equal(other
): boolean
Given two long count dates, check if they are equal
Name | Type |
---|---|
other |
IPart |
boolean
▸ equalWithComment(otherCommentWrapper
): boolean
Check equality including the associated comment.
Name | Type |
---|---|
otherCommentWrapper |
IPart |
boolean
DistanceNumber.equalWithComment
▸ exactlyEqual(other
): boolean
Given two long count dates, check if they are exactly equal
Name | Type |
---|---|
other |
DistanceNumber |
boolean
▸ getDateSections(index
): number
| Wildcard
Get specific column in Long Count fullDate
Name | Type |
---|---|
index |
number |
number
| Wildcard
DistanceNumber.getDateSections
▸ getPosition(): number
Count the number of days since 0.0.0.0.0 for this LC.
number
▸ gt(newLongCount
): boolean
Compare is this LC is less than the supplied LC.
Name | Type |
---|---|
newLongCount |
DistanceNumber |
boolean
▸ isPartial(): boolean
Returns true if any of the positions in the Long Count have been assigned a {Wildcard} object.
boolean
▸ isValid(): boolean
Ensure the fullDate has only numbers and wildcards separated by points.
boolean
▸ lt(newLongCount
): boolean
Compare if this LC is greater than the supplied LC.
Name | Type |
---|---|
newLongCount |
DistanceNumber |
boolean
▸ map(fn
): any
[]
Pass the map down to the parts
Name | Type |
---|---|
fn |
(lcPart : number | Wildcard , lcPartIndex : number ) => any |
any
[]
▸ minus(newLc
): LongcountSubtraction
Return the difference between this Long Count and the supplied
Name | Type |
---|---|
newLc |
LongCount |
▸ normalise(): DistanceNumber
Make sure the elements of the Long Count do not exceed
▸ plus(newLc
): LongcountAddition
Return the sum of this Long Count and the supplied
Name | Type |
---|---|
newLc |
LongCount |
▸ setComment(comment
): any
Replace the current comment.
Name | Type |
---|---|
comment |
string | Comment |
any
▸ setCorrelationConstant(newConstant
): LongCount
Chainable method to set the correlation constant
Name | Type |
---|---|
newConstant |
CorrelationConstant |
▸ setDateSections(index
, newValue
): LongCount
Set specific column in Long Count fullDate
Name | Type |
---|---|
index |
number |
newValue |
number | Wildcard |
DistanceNumber.setDateSections
▸ toString(): string
Convert the LongCount to a string and pad the sections of the fullDate
string
▸ Static
fromDistanceNumber(dn
): LongCount
Name | Type |
---|---|
dn |
DistanceNumber |