pub trait IslamicBasedMarker {
const EPOCH: RataDie;
const DEBUG_NAME: &'static str;
const HAS_353_DAY_YEARS: bool;
// Required methods
fn fixed_from_islamic(year: i32, month: u8, day: u8) -> RataDie;
fn islamic_from_fixed(date: RataDie) -> (i32, u8, u8);
// Provided methods
fn mean_synodic_ny(extended_year: i32) -> RataDie { ... }
fn approximate_islamic_from_fixed(date: RataDie) -> i32 { ... }
fn month_lengths_for_year(extended_year: i32, ny: RataDie) -> [bool; 12] { ... }
}
Expand description
Common abstraction over islamic-style calendars
Required Associated Constants§
sourceconst EPOCH: RataDie
const EPOCH: RataDie
The epoch of the calendar. Different calendars use a different epoch (Thu or Fri) due to disagreement on the exact date of Mohammed’s migration to Mecca.
sourceconst DEBUG_NAME: &'static str
const DEBUG_NAME: &'static str
The name of the calendar for debugging.
sourceconst HAS_353_DAY_YEARS: bool
const HAS_353_DAY_YEARS: bool
Whether this calendar is known to have 353-day years. This is probably a bug; see https://github.com/unicode-org/icu4x/issues/4930
Required Methods§
Provided Methods§
sourcefn mean_synodic_ny(extended_year: i32) -> RataDie
fn mean_synodic_ny(extended_year: i32) -> RataDie
Given the extended year, calculate the approximate new year using the mean synodic month
sourcefn approximate_islamic_from_fixed(date: RataDie) -> i32
fn approximate_islamic_from_fixed(date: RataDie) -> i32
Given an iso date, calculate the approximate islamic year it corresponds to (for quick cache lookup)
Object Safety§
This trait is not object safe.