Skip to content

Add real-persian (Imperial/Shahanshahi) calendar#16

Open
iranajdev wants to merge 1 commit intoshahabyazdi:masterfrom
iranajdev:feature/old-persian-calendar
Open

Add real-persian (Imperial/Shahanshahi) calendar#16
iranajdev wants to merge 1 commit intoshahabyazdi:masterfrom
iranajdev:feature/old-persian-calendar

Conversation

@iranajdev
Copy link

Summary

  • Add a new calendar at calendars/real-persian that uses the same Solar calendar as the modern Persian (Solar Hijri) but counts years from the founding of the Achaemenid Empire by Cyrus the Great (559 BCE)
  • The year offset of 1180 is computed programmatically: HIJRI_EPOCH_CE (622) + ACHAEMENID_EPOCH_BCE (559) - 1
  • Example: Persian year 1404 displays as Imperial year 2584

Changes

  • src/calendars/real-persian.js — new calendar source wrapping the Persian calendar with year offset
  • rollup.config.js — added buildCustom() to build custom calendars from src/
  • index.d.ts — TypeScript declaration for the new calendar module
  • .gitignore — scoped ignore patterns to top-level build output directories only

Test plan

  • Verified year offset: Persian 1404 → Imperial 2584 (offset = 1180)
  • Verified leap year consistency between Persian and Imperial calendars
  • Verified calendar conversion roundtrip (Imperial ↔ Persian)
  • Verified day/month consistency across both calendars
  • Verified rollup build succeeds

🤖 Generated with Claude Code

Add a new calendar option at calendars/real-persian that uses the same
Solar calendar as the modern Persian (Solar Hijri) but counts years from
the founding of the Achaemenid Empire by Cyrus the Great (559 BCE),
giving a programmatically computed year offset of 1180 (622 + 559 - 1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants