@drewsonne/maya-dates / Exports / 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");
↳ CalendarRound
• new CalendarRound(tzolkin
, haab
)
Name | Type |
---|---|
tzolkin |
Tzolkin |
haab |
Haab |
• comment: Comment
Attached comment.
• haab: Haab
• tzolkin: Tzolkin
▸ appendComment(comment
): any
Append additional text to the current comment.
Name | Type |
---|---|
comment |
string | Comment |
any
▸ commentIsEqual(otherCommentWrapper
): boolean
Compare this wrapper’s comment against another wrapper.
Name | Type |
---|---|
otherCommentWrapper |
CommentWrapper |
boolean
▸ equal(other
): boolean
Compare this object with another for equality.
Name | Type |
---|---|
other |
IPart |
boolean
▸ equalWithComment(otherCommentWrapper
): boolean
Check equality including the associated comment.
Name | Type |
---|---|
otherCommentWrapper |
IPart |
boolean
CommentWrapper.equalWithComment
▸ isPartial(): boolean
Return true, if this function has any wildcard portions.
boolean
▸ 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.
Name | Type |
---|---|
newCr |
CalendarRound |
boolean
▸ minus(targetCr
): DistanceNumber
Return a long count date representing the difference between two dates.
Name | Type |
---|---|
targetCr |
CalendarRound |
▸ next(): CalendarRound
Increment both the Haab and 260-day cycle to the next day in the Calendar Round
▸ setComment(comment
): any
Replace the current comment.
Name | Type |
---|---|
comment |
string | Comment |
any
▸ shift(increment
): CalendarRound
Shift a CalendarRound forward through time. Does not modify this object and will return a new object.
Name | Type |
---|---|
increment |
number |
▸ toString(): string
Render the CalendarRound cycle fullDate as a string
string
▸ validate(): void
Validate that the Calendar Round has a correct 260-day and Haab configuration
void
Throws
If the Calendar Round is invalid.