pub struct Hebrew;Expand description
The Hebrew Calendar
The Hebrew calendar is a lunisolar calendar used as the Jewish liturgical calendar as well as an official calendar in Israel.
This implementation uses civil month numbering, where Tishrei is the first month of the year.
The precise algorithm used to calculate the Hebrew Calendar has changed over time, with the modern one being in place since about 4536 AM (776 CE). This implementation extends proleptically for dates before that.
This corresponds to the "hebrew" CLDR calendar.
§Era codes
This calendar uses a single era code am, Anno Mundi. Dates before this era use negative years.
§Months and days
The 12 months are called Tishrei (M01, 30 days), Ḥešvan (M02, 29/30 days),
Kīslev (M03, 30/29 days), Ṭevet (M04, 29 days), Šəvaṭ (M05, 30 days), ʾĂdār (M06, 29 days),
Nīsān (M07, 30 days), ʾĪyyar (M08, 29 days), Sivan (M09, 30 days), Tammūz (M10, 29 days),
ʾAv (M11, 30 days), ʾElūl (M12, 29 days).
Due to Rosh Hashanah postponement rules, Ḥešvan and Kislev vary in length.
In leap years (years 3, 6, 8, 11, 17, 19 in a 19-year cycle), the leap month Adar I (M05L, 30 days)
is inserted before Adar, and Adar is called Adar II (the formatting_code returned by MonthInfo
will be M06L to mark this, while the standard_code remains M06).
Standard years thus have 353-355 days, and leap years 383-385.
Implementations§
Trait Implementations§
Source§impl Calendar for Hebrew
impl Calendar for Hebrew
Source§type DifferenceError = Infallible
type DifferenceError = Infallible
untilSource§fn from_codes(
&self,
era: Option<&str>,
year: i32,
month_code: MonthCode,
day: u8,
) -> Result<<Hebrew as Calendar>::DateInner, DateError>
fn from_codes( &self, era: Option<&str>, year: i32, month_code: MonthCode, day: u8, ) -> Result<<Hebrew as Calendar>::DateInner, DateError>
Source§fn from_rata_die(&self, rd: RataDie) -> <Hebrew as Calendar>::DateInner
fn from_rata_die(&self, rd: RataDie) -> <Hebrew as Calendar>::DateInner
RataDieSource§fn to_rata_die(&self, date: &<Hebrew as Calendar>::DateInner) -> RataDie
fn to_rata_die(&self, date: &<Hebrew as Calendar>::DateInner) -> RataDie
RataDie from this dateSource§fn has_cheap_iso_conversion(&self) -> bool
fn has_cheap_iso_conversion(&self) -> bool
from_iso/to_iso is more efficient
than from_rata_die/to_rata_die.Source§fn months_in_year(&self, date: &<Hebrew as Calendar>::DateInner) -> u8
fn months_in_year(&self, date: &<Hebrew as Calendar>::DateInner) -> u8
Source§fn days_in_year(&self, date: &<Hebrew as Calendar>::DateInner) -> u16
fn days_in_year(&self, date: &<Hebrew as Calendar>::DateInner) -> u16
Source§fn days_in_month(&self, date: &<Hebrew as Calendar>::DateInner) -> u8
fn days_in_month(&self, date: &<Hebrew as Calendar>::DateInner) -> u8
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Source§fn year_info(
&self,
date: &<Hebrew as Calendar>::DateInner,
) -> <Hebrew as Calendar>::Year
fn year_info( &self, date: &<Hebrew as Calendar>::DateInner, ) -> <Hebrew as Calendar>::Year
Source§fn is_in_leap_year(&self, date: &<Hebrew as Calendar>::DateInner) -> bool
fn is_in_leap_year(&self, date: &<Hebrew as Calendar>::DateInner) -> bool
Source§fn month(&self, date: &<Hebrew as Calendar>::DateInner) -> MonthInfo
fn month(&self, date: &<Hebrew as Calendar>::DateInner) -> MonthInfo
dateSource§fn day_of_month(&self, date: &<Hebrew as Calendar>::DateInner) -> DayOfMonth
fn day_of_month(&self, date: &<Hebrew as Calendar>::DateInner) -> DayOfMonth
dateSource§fn day_of_year(&self, date: &<Hebrew as Calendar>::DateInner) -> DayOfYear
fn day_of_year(&self, date: &<Hebrew as Calendar>::DateInner) -> DayOfYear
Source§fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
CalendarAlgorithm that is required to match
when parsing into this calendar. Read moreSource§fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
Source§fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
Source§fn extended_year(&self, date: &Self::DateInner) -> i32
fn extended_year(&self, date: &Self::DateInner) -> i32
Source§impl CldrCalendar for Hebrew
impl CldrCalendar for Hebrew
Source§type YearNamesV1 = DatetimeNamesYearHebrewV1
type YearNamesV1 = DatetimeNamesYearHebrewV1
Source§type MonthNamesV1 = DatetimeNamesMonthHebrewV1
type MonthNamesV1 = DatetimeNamesMonthHebrewV1
Source§type SkeletaV1 = DatetimePatternsDateHebrewV1
type SkeletaV1 = DatetimePatternsDateHebrewV1
Source§impl From<Hebrew> for AnyCalendar
impl From<Hebrew> for AnyCalendar
Source§fn from(value: Hebrew) -> AnyCalendar
fn from(value: Hebrew) -> AnyCalendar
Source§impl IntoAnyCalendar for Hebrew
impl IntoAnyCalendar for Hebrew
Source§fn to_any(self) -> AnyCalendar
fn to_any(self) -> AnyCalendar
AnyCalendar, moving it Read moreSource§fn kind(&self) -> AnyCalendarKind
fn kind(&self) -> AnyCalendarKind
AnyCalendarKind enum variant associated with this calendarSource§fn from_any(any: AnyCalendar) -> Result<Hebrew, AnyCalendar>
fn from_any(any: AnyCalendar) -> Result<Hebrew, AnyCalendar>
Source§fn from_any_ref(any: &AnyCalendar) -> Option<&Hebrew>
fn from_any_ref(any: &AnyCalendar) -> Option<&Hebrew>
Source§impl Ord for Hebrew
impl Ord for Hebrew
Source§impl PartialOrd for Hebrew
impl PartialOrd for Hebrew
impl Copy for Hebrew
impl Eq for Hebrew
impl IntoFormattableAnyCalendar for Hebrew
impl StructuralPartialEq for Hebrew
impl UnstableSealed for Hebrew
Auto Trait Implementations§
impl Freeze for Hebrew
impl RefUnwindSafe for Hebrew
impl Send for Hebrew
impl Sync for Hebrew
impl Unpin for Hebrew
impl UnwindSafe for Hebrew
Blanket Implementations§
Source§impl<C> AsCalendar for Cwhere
C: Calendar,
impl<C> AsCalendar for Cwhere
C: Calendar,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more