Module icu_calendar::hebrew
source · Expand description
This module contains types and implementations for the Hebrew calendar.
use icu::calendar::{Date, DateTime};
// `Date` type
let hebrew_date = Date::try_new_hebrew_date(3425, 10, 11)
.expect("Failed to initialize hebrew Date instance.");
// `DateTime` type
let hebrew_datetime =
DateTime::try_new_hebrew_datetime(3425, 10, 11, 13, 1, 0)
.expect("Failed to initialize hebrew DateTime instance.");
// `Date` checks
assert_eq!(hebrew_date.year().number, 3425);
assert_eq!(hebrew_date.month().ordinal, 10);
assert_eq!(hebrew_date.day_of_month().0, 11);
// `DateTime` checks
assert_eq!(hebrew_datetime.date.year().number, 3425);
assert_eq!(hebrew_datetime.date.month().ordinal, 10);
assert_eq!(hebrew_datetime.date.day_of_month().0, 11);
assert_eq!(hebrew_datetime.time.hour.number(), 13);
assert_eq!(hebrew_datetime.time.minute.number(), 1);
assert_eq!(hebrew_datetime.time.second.number(), 0);
Structs§
- The Civil Hebrew Calendar