when-am-i / commit
Add Aztec/Mexica calendars (Xiuhpohualli, year-bearer, Tonalpohualli)
README.md | 31 +++++----- .../calendars/aztec/01-aztec-xiuhp-hualli.png | Bin 0 -> 844544 bytes .../aztec/02-aztec-mexica-year-bearer.png | Bin 0 -> 844544 bytes screenshots/calendars/aztec/03-t-nalp-hualli.png | Bin 0 -> 845017 bytes src/data/calendars/aztec.json | 65 +++++++++++++++++++++ src/utils/calendars.test.ts | 11 ++++ src/utils/calendars.ts | 36 ++++++++++++ 7 files changed, 126 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7b0c453..f7aaf2d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [](https://gitlab.com/PavelSafronov/when-am-i/-/pipelines) [](https://pavelsafronov.gitlab.io/when-am-i)  - +   @@ -62,9 +62,10 @@ and show the Gregorian year for reference). (Dangun era, South Korea), Juche (North Korea, 1997–2024). - **Descriptive-only:** the Chinese sexagenary cycle (the named 60-year stem-branch / zodiac-animal year), the Korean and Japanese pre-modern - lunisolar calendars, the Tzolk'in/Haab' Calendar Round, the Ottoman Rumi - fiscal calendar, the Māori maramataka, and observational lunar calendars such - as the Algonquian (Massachusett) reckoning. + lunisolar calendars, the Tzolk'in/Haab' Calendar Round, the Aztec/Mexica + year-bearer (52-year cycle) and Tōnalpōhualli (260-day ritual cycle), the + Ottoman Rumi fiscal calendar, the Māori maramataka, and observational lunar + calendars such as the Algonquian (Massachusett) reckoning. ## Tech Stack @@ -261,34 +262,30 @@ ship as descriptive-only. 3. **Mongolian calendar** — the Mongol Empire and successor states' lunisolar calendar (related to but distinct from the Chinese and Tibetan systems), spanning a vast historical territory. -4. **Aztec/Mexica calendar (Xiuhpohualli + Tonalpohualli)** — Mesoamerica's - other major calendar system alongside the Maya (already covered): a 365-day - solar count and a 260-day ritual count, used across central Mexico for - centuries before and during the Aztec Empire. -5. **Coptic calendar** — Egypt's calendar since antiquity (descended from the +4. **Coptic calendar** — Egypt's calendar since antiquity (descended from the ancient Egyptian civil calendar), still used liturgically by the Coptic Orthodox Church; distinct from but related to the Ethiopian calendar already supported. (Note: the Temporal `coptic` calendar id is broken in our polyfill version, same class of bug as `chinese`/`ethiopic` — would likely need a hand-rolled converter like Ethiopian's.) -6. **Ancient Egyptian civil calendar** — a 365-day calendar used for roughly +5. **Ancient Egyptian civil calendar** — a 365-day calendar used for roughly three millennia along the Nile; descriptive-only (no continuous numbered year survives in common use), but enormous time depth. -7. **Armenian calendar** — in continuous use since antiquity, with its own +6. **Armenian calendar** — in continuous use since antiquity, with its own epoch and a fixed 365-day year (no leap day), giving it a slow drift against the Gregorian year worth surfacing. -8. **Coast Salish / Puget Sound calendar** — a sourced, people-specific lunar +7. **Coast Salish / Puget Sound calendar** — a sourced, people-specific lunar reckoning for the Pacific Northwest, paralleling the Massachusett entry; the place/people this skill's original brainstorm named as an example. -9. **Inca calendar** — a lunisolar/solar calendar used across the Inca Empire's +8. **Inca calendar** — a lunisolar/solar calendar used across the Inca Empire's considerable territory in the Andes; mostly descriptive (reconstructions of its exact rules are debated, so sourcing needs care). -10. **Balinese Pawukon and Saka calendars** — Bali's parallel 210-day ritual - cycle and a Saka-derived solar count, both still in everyday use. -11. **Bahá'í calendar** — a 19-month, 19-day solar calendar in worldwide use +9. **Balinese Pawukon and Saka calendars** — Bali's parallel 210-day ritual + cycle and a Saka-derived solar count, both still in everyday use. +10. **Bahá'í calendar** — a 19-month, 19-day solar calendar in worldwide use since the mid-19th century; smaller area than the others here but a long enough span and clean enough arithmetic to be a good convertible candidate. -12. **Sikh Nanakshahi calendar** — a solar calendar adopted by the SGPC in 2003 +11. **Sikh Nanakshahi calendar** — a solar calendar adopted by the SGPC in 2003 for Sikh religious dates, with a clear epoch (Guru Nanak's birth year) — likely a simple convertible offset like Dangi/Juche. diff --git a/screenshots/calendars/aztec/01-aztec-xiuhp-hualli.png b/screenshots/calendars/aztec/01-aztec-xiuhp-hualli.png new file mode 100644 index 0000000..2bd4829 Binary files /dev/null and b/screenshots/calendars/aztec/01-aztec-xiuhp-hualli.png differ diff --git a/screenshots/calendars/aztec/02-aztec-mexica-year-bearer.png b/screenshots/calendars/aztec/02-aztec-mexica-year-bearer.png new file mode 100644 index 0000000..2bd4829 Binary files /dev/null and b/screenshots/calendars/aztec/02-aztec-mexica-year-bearer.png differ diff --git a/screenshots/calendars/aztec/03-t-nalp-hualli.png b/screenshots/calendars/aztec/03-t-nalp-hualli.png new file mode 100644 index 0000000..fc23553 Binary files /dev/null and b/screenshots/calendars/aztec/03-t-nalp-hualli.png differ diff --git a/src/data/calendars/aztec.json b/src/data/calendars/aztec.json new file mode 100644 index 0000000..636c2dd --- /dev/null +++ b/src/data/calendars/aztec.json @@ -0,0 +1,65 @@ +{ + "region": { + "name": "Aztec Empire (central Mexico)", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [-100.5, 21.5], + [-99.0, 21.8], + [-97.5, 20.8], + [-96.2, 19.2], + [-95.0, 18.0], + [-94.0, 16.2], + [-95.5, 15.5], + [-97.5, 15.8], + [-99.5, 16.5], + [-101.5, 17.7], + [-102.2, 18.8], + [-101.5, 20.0], + [-100.5, 21.5] + ] + ] + } + }, + "eras": [ + { + "name": "Xiuhpōhualli (365-day solar calendar)", + "start": "1325-01-01", + "end": "1521-08-13", + "calendar": "Aztec Xiuhpōhualli", + "usedBy": "the Aztec/Mexica", + "description": "The Mexica civil calendar: 18 months (veintenas) of 20 days each, plus a 5-day unlucky period (nēmontemi), totaling 365 days. It has no continuous numbered year — a year is named only by its position in the 52-year cycle (see the year-bearer era below). The exact day the year began is disputed among colonial-era sources (accounts place it anywhere from February to March), with no leap-day mechanism to keep it aligned to the solar year, so this dataset does not attempt a precise day-level conversion. Scoped here to the imperial period, from the traditional founding of Tenochtitlan (1325) to the fall of the city to the Spanish (13 August 1521), though Mesoamerican communities continued using related 365-day calendars informally long afterward.", + "sources": [ + "https://en.wikipedia.org/wiki/Xiuhp%C5%8Dhualli", + "https://en.wikipedia.org/wiki/Aztec_calendar", + "https://en.wikipedia.org/wiki/Tenochtitlan" + ] + }, + { + "name": "Year-bearer (52-year cycle)", + "start": "1325-01-01", + "end": "1521-08-13", + "calendar": "Aztec/Mexica year-bearer", + "usedBy": "the Aztec/Mexica", + "description": "Years were named by combining one of four day-signs — Ācatl (Reed), Tēcpatl (Flint), Calli (House), Tōchtli (Rabbit) — with a number 1–13, repeating every 52 years (the xiuhmolpilli, 'Calendar Round'); there is no Aztec equivalent of the Maya Long Count, so no absolute year number exists. The cycle is anchored here at 1519 CE = '1 Ācatl', documented because of its association with the Cortés-arrival/Quetzalcōātl-return prophecy, cross-checked against the 1507 New Fire Ceremony at the Hill of the Star, recorded as '2 Ācatl'.", + "sources": [ + "https://en.wikipedia.org/wiki/Aztec_calendar", + "https://en.wikipedia.org/wiki/Spanish_conquest_of_the_Aztec_Empire", + "https://en.wikipedia.org/wiki/New_Fire_ceremony" + ] + }, + { + "name": "Tōnalpōhualli (260-day ritual calendar)", + "start": "1325-01-01", + "end": null, + "calendar": "Tōnalpōhualli", + "usedBy": "the Aztec/Mexica and their descendants", + "description": "A 260-day cycle combining 20 day-signs with 13 numbers (e.g. a person named '5 Lizard' for their birth-day), used for divination, naming, and ritual timing rather than tracking elapsed years — it has no year count at all. Predates and outlasted the empire; related 260-day count calendars remain in ceremonial use among some Mesoamerican communities today, so this era is left open-ended.", + "sources": [ + "https://en.wikipedia.org/wiki/T%C5%8Dnalp%C5%8Dhualli", + "https://en.wikipedia.org/wiki/Aztec_calendar" + ] + } + ] +} diff --git a/src/utils/calendars.test.ts b/src/utils/calendars.test.ts index 92a04b7..ed35217 100644 --- a/src/utils/calendars.test.ts +++ b/src/utils/calendars.test.ts @@ -152,6 +152,17 @@ describe('convert', () => { expect(convert({ year: 1912, month: 1, day: 1 }, 'Juche').localYearLabel).toBe('Juche 1'); }); + it('names the Aztec/Mexica year-bearer (descriptive-only)', () => { + // 1519 CE is documented as "1 Ācatl" (Cortés's arrival). + const c = convert({ year: 1519, month: 6, day: 1 }, 'Aztec/Mexica year-bearer'); + expect(c.convertible).toBe(false); + expect(c.system).toBe('Aztec/Mexica year-bearer'); + expect(c.localDateLabel).toBe('1 Ācatl'); + expect(c.localYearLabel).toBe('1519'); // Gregorian reference + // 1507 CE is documented as "2 Ācatl" (the last pre-conquest New Fire Ceremony). + expect(convert({ year: 1507, month: 6, day: 1 }, 'Aztec year-bearer').localDateLabel).toBe('2 Ācatl'); + }); + it('Korean lunisolar calendar is descriptive-only but reports the moon', () => { const c = convert({ year: 1800, month: 4, day: 1 }, 'Korean lunisolar calendar'); expect(c.convertible).toBe(false); diff --git a/src/utils/calendars.ts b/src/utils/calendars.ts index c4e1b92..1ea3201 100644 --- a/src/utils/calendars.ts +++ b/src/utils/calendars.ts @@ -243,6 +243,40 @@ function sexagenaryConverter(date: HistoricalDate): CalendarConversion { }; } +// ── Aztec/Mexica year-bearer (hand-rolled, descriptive) ────────────────────── +// The Aztec/Mexica Xiuhpōhualli (365-day solar year) has no continuous year +// number — only a name from the 52-year cycle (xiuhmolpilli), combining one of +// 4 day-signs (Ācatl/Reed, Tēcpatl/Flint, Calli/House, Tōchtli/Rabbit) with a +// number 1–13, e.g. "1 Ācatl". There is no Aztec equivalent of the Maya Long +// Count (no continuous count from a fixed epoch), so this stays descriptive +// even though the cycle itself is fully deterministic. Anchored at 1519 CE = +// "1 Ācatl" (the year of Cortés's arrival, widely documented because of its +// association with the Quetzalcōātl-return prophecy) — cross-checked against +// the 1507 New Fire Ceremony, documented as "2 Ācatl" (1507 + 12 = 1519, and +// 2 Ācatl + 12 in the 13-number sequence wraps to 1 Ācatl, consistent). The +// exact day the Xiuhpōhualli year turned over is disputed among sources +// (accounts place it anywhere from February to March), so we approximate with +// a Gregorian-year turnover and flag the caveat, as with the Chinese +// sexagenary cycle above. +const YEAR_BEARERS = ['Calli', 'Tōchtli', 'Ācatl', 'Tēcpatl']; // House, Rabbit, Reed, Flint +const YEAR_BEARER_ANCHOR_YEAR = 1519; // "1 Ācatl" +const YEAR_BEARER_ANCHOR_NUMBER = 1; +const YEAR_BEARER_ANCHOR_SIGN_INDEX = 2; // Ācatl + +function aztecYearBearerConverter(date: HistoricalDate): CalendarConversion { + const offset = date.year - YEAR_BEARER_ANCHOR_YEAR; + const number = (((YEAR_BEARER_ANCHOR_NUMBER - 1 + offset) % 13) + 13) % 13 + 1; + const signIndex = (((YEAR_BEARER_ANCHOR_SIGN_INDEX + offset) % 4) + 4) % 4; + const name = `${number} ${YEAR_BEARERS[signIndex]}`; + return { + system: 'Aztec/Mexica year-bearer', + localYearLabel: yearLabel(date.year), // Gregorian reference year + localDateLabel: name, + convertible: false, + note: 'Years are named in a repeating 52-year cycle (one of four day-signs — Ācatl/Reed, Tēcpatl/Flint, Calli/House, Tōchtli/Rabbit — with a number 1–13), not numbered continuously; there is no Aztec equivalent of the Maya Long Count. The exact day the year turned over is disputed among historical sources, so this approximates with a Gregorian-year turnover.', + }; +} + // ── Maya Long Count (hand-rolled) ──────────────────────────────────────────── // The Long Count is the Maya system with a continuous day count from a fixed // epoch, unlike the cyclical Tzolk'in (260-day) and Haab' (365-day) calendars @@ -363,6 +397,8 @@ const CONVERTERS: Record<string, Converter> = { 'dangi': dangiConverter, 'dangun era': dangiConverter, 'juche': jucheConverter, + 'aztec/mexica year-bearer': aztecYearBearerConverter, + 'aztec year-bearer': aztecYearBearerConverter, }; for (const { names, def } of TEMPORAL_CALENDARS) {