Skip to main content

Crate shahanshahi

Crate shahanshahi 

Source
Expand description

Shahanshahi (Imperial Iranian) calendar.

This crate is spec-first: SPEC.md defines calendar rules (SPEC_VERSION). Golden rows in data/reference-dates.json anchor tests; public APIs may still evolve before 1.0.0 (see SemVer policy in the repo changelog).

§Types

§Features

Structs§

ChronoNaiveDateOutOfRange
The Gregorian civil date is valid for GregorianDate but cannot be represented as a chrono::NaiveDate (chrono limits the representable year range).
GregorianDate
A valid proleptic Gregorian civil date (year, month 1..=12, day consistent with month/leap rule).
ShahanshahiDate
A valid civil date in the Shahanshahi (Imperial Iranian) calendar: 1 = Farvardin … 12 = Esfand, with month lengths from the 1925 solar civil law (SPEC.md § Months). Leap Esfand uses Mode A (33-year arithmetic) on the underlying Hijri Shamsi year Y_H = Y_S − 1180.

Enums§

GregorianDateError
Why a GregorianDate could not be constructed.
ShahanshahiDateError
Why a ShahanshahiDate could not be constructed.

Constants§

SPEC_VERSION
Tracks which written specification version this build targets.

Functions§

is_shahanshahi_leap_arithmetic
Shahanshahi leap year using Mode A (same solar year as underlying Hijri Shamsi).
is_solar_hijri_leap_arithmetic
Solar Hijri leap year per the 33-year arithmetic rule (Heydari-Malayeri / Borkowski range).
shahanshahi_to_hijri_shamsi_year
Underlying Solar Hijri year from Shahanshahi year (proleptic offset).