Skip to content

Tempo Plugin

@tempo-kit/plugin-cultural ​

npm version npm peer dependency version License TypeScript Ready

The Cultural Plugin provides traditional, historical, and lunisolar calendar Terms for Tempo — combining Western & East Asian zodiacs with Temporal-native Japanese Imperial Eras, Islamic Hijri, and Hebrew calendars.


Key Features ​

  • ZodiacTerm (#zdc, #zodiac, #sunSign, #starSign) — Western Tropical Zodiac signs with symbols, emojis, traits, shorthand navigation, ordinals, and formatting.
  • EasternTerm (#sign, #shengxiao, #lunarSign, #eastern) — East Asian Sexagenary Zodiac cycle with 5 elements, Yin/Yang polarity, and regional variants (cn, jp, kr, vn).
  • NengoTerm (#nengo, #era, #wareki) — Japanese Imperial Eras (Meiji, Taishō, Shōwa, Heisei, Reiwa) powered by Temporal's 'japanese' calendar with kanji, ASCII codes (R8), 元年 formatting, and open-ended OpenTermSpan (end: null) for the active Reiwa era.
  • HijriTerm (#hijri, #islamic, #islamicMonth) — Islamic Hijri months powered by Temporal ('islamic-umalqura', 'islamic-civil', 'islamic-tbla') with Arabic script, sacred-month flags, and exact month spans.
  • HebrewTerm (#hebrew, #hebrewMonth) — Hebrew lunisolar months powered by Temporal's 'hebrew' calendar with Hebrew script, automatic Metonic leap-year Adar I / Adar II resolution, and exact month spans.
  • JieqiTerm (#jieqi, #sekki, #solarTerm) — East Asian 24 Solar Terms computed via a self-contained Meeus solar longitude solver with cn / jp / kr / vn variants.
  • LiturgicalTerm (#liturgy, #ecclesiastical, #liturgical) — Western Christian Liturgical seasons via Gregorian Computus with liturgical colors and 3-year Sunday lectionary cycle (A / B / C).
  • QuarterDaysTerm (#qday, #crossQuarter, #quarterDay) — Contiguous English, Scottish, and Celtic quarter/cross-quarter day periods.
  • GenerationTerm (#gen, #generation) — Pew Research demographic cohorts (or custom ranges) with open-ended OpenTermSpan for the active cohort.
  • createCalendarTerm (@tempo-kit/plugin-cultural/calendar) — Generic zero-table factory unlocking any Temporal calendar on demand without crowding t.term.*.
  • Opt-In Global Calendar Terms (subpath imports, keeping CulturalPlugin lean):
    • PersianTerm (@tempo-kit/plugin-cultural/persian, #persian, #jalali, #shamsi) — Solar Hijri calendar with Persian script and seasonal alignment.
    • IndianTerm (@tempo-kit/plugin-cultural/indian, #indian, #saka) — Indian National (Saka) civil calendar with Devanagari script.
    • EthiopianTerm & CopticTerm (.../ethiopian, .../coptic) — 13-month calendars with Ge'ez / Coptic script and epagomenal month flags.
    • BuddhistTerm (@tempo-kit/plugin-cultural/buddhist, #buddhist, #thai) — Thai Solar Buddhist Era (year + 543) with Thai month names and abbreviations.
    • ChineseLunarTerm (@tempo-kit/plugin-cultural/chinese-lunar, #nongli, #chineseMonth, #chineseLunar) — Chinese ('chinese') and Korean ('dangi') lunisolar months with intercalary leap months (M01L–M12L) and 60-year Sexagenary ganzhi stems & branches.
  • Granular Tree-Shakeable Subpaths: Import the full CulturalPlugin bundle or individual terms via @tempo-kit/plugin-cultural/{zodiac,eastern,nengo,hijri,hebrew,jieqi,liturgical,quarter-days,generation,calendar,persian,indian,ethiopian,coptic,buddhist,chinese-lunar}.

NOTE

EasternTerm defaults to Gregorian year boundaries ({yyyy}-01-01 → next year's 01-01). For exact Chinese New Year transitions, register createEasternTerm({ boundary: 'lunisolar' }).


Installation ​

bash
npm install tempo-kit @tempo-kit/plugin-cultural

Quickstart ​

Interactive Demo (@tempo-kit/plugin-cultural)
Open in Full REPL↗
// 🏮 Cultural & Traditional Calendar Terms (@tempo-kit/plugin-cultural)
const { CulturalPlugin } = await import('@tempo-kit/plugin-cultural');
Tempo.use(CulturalPlugin);

const t = new Tempo('2026-04-05T12:00:00Z');

// 1. Western & Eastern Zodiacs
console.log('Western Zodiac:', t.term.zodiac.emoji, t.term.zdc);
console.log('Eastern Zodiac:', t.term.shengxiao.emoji, t.term.shengxiao.element, t.term.sign);

// 2. Japanese Imperial Era (Nengō / Wareki)
console.log('Japanese Era:', t.term.nengo, '->', t.term.era.formatted, '(' + t.term.era.code + t.term.era.eraYear + ')');

// 3. Islamic Hijri & Hebrew Lunisolar Calendars
console.log('Hijri Month:', t.term.hijri, t.term.islamic.year, '(' + t.term.islamic.arabic + ')');
console.log('Hebrew Month:', t.term.hebrew, t.term.hebrewMonth.year, '(' + t.term.hebrewMonth.hebrew + ')');

// 4. Solar Terms, Liturgical Year, Quarter Days & Generations
console.log('Solar Term (Jiéqì):', t.term.jieqi, '(' + t.term.solarTerm.variants.cn.name + ', ' + t.term.solarTerm.english + ')');
console.log('Liturgical Season:', t.term.liturgy, '(Year ' + t.term.liturgical.liturgicalYear + ', ' + t.term.liturgical.color + ')');
console.log('Quarter Day Period:', t.term.qday, '(' + t.term.quarterDay.dateLabel + ')');
console.log('Generation Cohort:', t.term.gen, '(open-ended end:', t.term.generation.span.end + ')');

return t.format('{#zdc.emoji} {#zdc} • {#nengo.formatted} • {#jieqi} • {#liturgy}');
Executes 100% in browser via native ESM sandbox
typescript
import { Tempo } from 'tempo-kit';
import { CulturalPlugin } from '@tempo-kit/plugin-cultural';

Tempo.use(CulturalPlugin);

const t = new Tempo('2026-04-05T12:00:00Z');
console.log(t.term.zdc);                 // 'Aries'
console.log(t.term.zodiac.emoji);        // '♈'
console.log(t.term.sign);                // 'Horse'
console.log(t.term.shengxiao.element);   // 'Fire'
console.log(t.term.era.formatted);       // '令和8年'
console.log(t.term.hijri);               // 'Shawwal'
console.log(t.term.hebrew);              // 'Nisan'

Granular Term Imports ​

typescript
import { Tempo } from 'tempo-kit/core';
import { NengoTerm } from '@tempo-kit/plugin-cultural/nengo';
import { HijriTerm, createHijriTerm } from '@tempo-kit/plugin-cultural/hijri';
import { HebrewTerm } from '@tempo-kit/plugin-cultural/hebrew';

Tempo.use([NengoTerm, HijriTerm, HebrewTerm]);

// Or configure an alternate Islamic calendar variant:
// Tempo.use(createHijriTerm({ calendar: 'islamic-civil' }));

Side-Effect Auto-Registration ​

typescript
import '@tempo-kit/plugin-cultural/install';

Open-Ended Spans (OpenTermSpan) ​

Active or unbounded eras (such as Reiwa in NengoTerm) use null for unbounded endpoints, mirroring Tempo.Interval:

  • Open end (end: null): total, remaining, and progress are null, while start and elapsed remain live.
  • Open start (start: null): total, elapsed, and progress are null, while end and remaining remain live.
  • Closed historical eras: Return a full closed TermSpan.

Topic Guides ​

Explore detailed guides on each calendar system and production integration patterns:


License ​

This is a Community plugin. It is completely free and open-source for personal and commercial use under the MIT license.

Released under the MIT License.