maya-dates

@drewsonne/maya-dates / Exports / CalendarRound

Class: CalendarRound

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");

Hierarchy

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CalendarRound(tzolkin, haab)

Parameters

Name Type
tzolkin Tzolkin
haab Haab

Overrides

CommentWrapper.constructor

Defined in

cr/calendar-round.ts:41

Properties

comment

comment: Comment

Attached comment.

Inherited from

CommentWrapper.comment

Defined in

comment-wrapper.ts:11


haab

haab: Haab

Defined in

cr/calendar-round.ts:39


tzolkin

tzolkin: Tzolkin

Defined in

cr/calendar-round.ts:38

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


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

Compare this object with another for equality.

Parameters

Name Type
other IPart

Returns

boolean

Implementation of

IPart.equal

Defined in

cr/calendar-round.ts:176


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


isPartial

isPartial(): boolean

Return true, if this function has any wildcard portions.

Returns

boolean

Defined in

cr/calendar-round.ts:162


match

match(newCr): boolean

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

Parameters

Name Type
newCr CalendarRound

Returns

boolean

Defined in

cr/calendar-round.ts:143


minus

minus(targetCr): DistanceNumber

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

Parameters

Name Type
targetCr CalendarRound

Returns

DistanceNumber

Defined in

cr/calendar-round.ts:107


next

next(): CalendarRound

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

Returns

CalendarRound

Defined in

cr/calendar-round.ts:100


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


shift

shift(increment): CalendarRound

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

Parameters

Name Type
increment number

Returns

CalendarRound

Defined in

cr/calendar-round.ts:152


toString

toString(): string

Render the CalendarRound cycle fullDate as a string

Returns

string

Defined in

cr/calendar-round.ts:172


validate

validate(): void

Validate that the Calendar Round has a correct 260-day and Haab configuration

Returns

void

Throws

If the Calendar Round is invalid.

Defined in

cr/calendar-round.ts:60