Skip to main content

CalendarRound

Defined in: cr/calendar-round.ts:37

A combination of 260-day cycles and the Haab cycle. This class should not be instantiated directly, and should be accessed through getCalendarRound.

See

Example

let cr = new CalendarRound(4, "Ajaw", 8, "Kumk'u");

Extends

Implements

Constructors

Constructor

new CalendarRound(tzolkin, haab): CalendarRound

Defined in: cr/calendar-round.ts:41

Parameters

tzolkin

Tzolkin

haab

Haab

Returns

CalendarRound

Overrides

CommentWrapper.constructor

Properties

comment

comment: Comment

Defined in: comment-wrapper.ts:11

Attached comment.

Inherited from

CommentWrapper.comment


haab

haab: Haab

Defined in: cr/calendar-round.ts:39


tzolkin

tzolkin: Tzolkin

Defined in: cr/calendar-round.ts:38

Methods

appendComment()

appendComment(comment): this

Defined in: comment-wrapper.ts:42

Append additional text to the current comment.

Parameters

comment

string | Comment

Returns

this

Inherited from

CommentWrapper.appendComment


commentIsEqual()

commentIsEqual(otherCommentWrapper): boolean

Defined in: comment-wrapper.ts:60

Compare this wrapper's comment against another wrapper.

Parameters

otherCommentWrapper

CommentWrapper

Returns

boolean

Inherited from

CommentWrapper.commentIsEqual


equal()

equal(other): boolean

Defined in: cr/calendar-round.ts:246

Compare this object with another for equality.

Parameters

other

IPart

Returns

boolean

Implementation of

IPart.equal


equalWithComment()

equalWithComment(otherCommentWrapper): boolean

Defined in: comment-wrapper.ts:67

Check equality including the associated comment.

Parameters

otherCommentWrapper

IPart

Returns

boolean

Inherited from

CommentWrapper.equalWithComment


isPartial()

isPartial(): boolean

Defined in: cr/calendar-round.ts:232

Return true, if this function has any wildcard portions.

Returns

boolean


match()

match(newCr): boolean

Defined in: cr/calendar-round.ts:213

Check that this Calendar Round matches another CalendarRound. If one CR has wildcards and the other does not, this function will return true.

Parameters

newCr

CalendarRound

Returns

boolean


minus()

minus(targetCr): DistanceNumber

Defined in: cr/calendar-round.ts:177

Return a long count date representing the difference between two dates.

Parameters

targetCr

CalendarRound

Returns

DistanceNumber


next()

next(): CalendarRound

Defined in: cr/calendar-round.ts:170

Increment both the Haab and 260-day cycle to the next day in the Calendar Round

Returns

CalendarRound


resetComment()

resetComment(): this

Defined in: comment-wrapper.ts:20

Reset the current comment back to an empty comment.

Returns

this

Inherited from

CommentWrapper.resetComment


setComment()

setComment(comment): this

Defined in: comment-wrapper.ts:28

Replace the current comment.

Parameters

comment

string | Comment

Returns

this

Inherited from

CommentWrapper.setComment


shift()

shift(increment): CalendarRound

Defined in: cr/calendar-round.ts:222

Shift a CalendarRound forward through time. Does not modify this object and will return a new object.

Parameters

increment

number

Returns

CalendarRound


toString()

toString(): string

Defined in: cr/calendar-round.ts:242

Render the CalendarRound cycle fullDate as a string

Returns

string


validate()

validate(): void

Defined in: cr/calendar-round.ts:64

Validate that the Calendar Round has a correct 260-day and Haab configuration using both mathematical and enumeration checks.

Per spec [R7], a Calendar Round exists iff the full cycle residues satisfy: r365 ≡ r260 (mod 5), where gcd(365, 260) = 5

Returns

void

Throws

If the Calendar Round is invalid.