Struct hijri_date::HijriDate
source · pub struct HijriDate { /* private fields */ }
Expand description
Main structure.
- Contains numeric value of hijri and gregorian dates plus hijri month and day names.
- Hijri names dosent have suffix, example (day,month,year,..)
- Gregorian names are denoted with
gr
oren
suffix.
Implementations§
source§impl HijriDate
impl HijriDate
sourcepub fn month_name(&self) -> String
pub fn month_name(&self) -> String
Get the name of the month in the Hijri calendar
sourcepub fn day_gr(&self) -> usize
pub fn day_gr(&self) -> usize
Get the day of the week (Gregorian) corresponding to the Hijri date
sourcepub fn month_gr(&self) -> usize
pub fn month_gr(&self) -> usize
Get the month of the year (Gregorian) corresponding to the Hijri date
sourcepub fn day_name_en(&self) -> String
pub fn day_name_en(&self) -> String
Get the English name of the day in the Hijri calendar
sourcepub fn month_name_en(&self) -> String
pub fn month_name_en(&self) -> String
Get the English name of the month in the Hijri calendar
pub fn wasm_to_string(&self) -> String
sourcepub fn from_hijri(
year: usize,
month: usize,
day: usize
) -> Result<HijriDate, String>
pub fn from_hijri( year: usize, month: usize, day: usize ) -> Result<HijriDate, String>
get data from hijri date
sourcepub fn from_gr(
year_gr: usize,
month_gr: usize,
day_gr: usize
) -> Result<HijriDate, String>
pub fn from_gr( year_gr: usize, month_gr: usize, day_gr: usize ) -> Result<HijriDate, String>
get data from gregorian date.
sourcepub fn format(&self, f: &str) -> String
pub fn format(&self, f: &str) -> String
Returns a representation of HijriDate defined by the given formatter
hijri
%Y hijri_year
%m hijri_month
%d hijri_day
%D hijri_day_name
%M hijri_month_name
%l hijri_month_len
gregorian
%gY gregorian_year
%gm gregorian_month
%gd gregorian_day
%gD gregorian_day_name
%gM gregorian_month_name
Trait Implementations§
source§impl PartialEq<HijriDate> for HijriDate
impl PartialEq<HijriDate> for HijriDate
source§impl PartialOrd<HijriDate> for HijriDate
impl PartialOrd<HijriDate> for HijriDate
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for HijriDate
impl StructuralEq for HijriDate
impl StructuralPartialEq for HijriDate
Auto Trait Implementations§
impl RefUnwindSafe for HijriDate
impl Send for HijriDate
impl Sync for HijriDate
impl Unpin for HijriDate
impl UnwindSafe for HijriDate
Blanket Implementations§
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
Mutably borrows from an owned value. Read more