Struct hijri_date::HijriDate [−][src]
pub struct HijriDate { pub day: usize, pub month: usize, pub month_len: usize, pub year: usize, pub day_name: String, pub month_name: String, pub day_gr: usize, pub month_gr: usize, pub year_gr: usize, pub day_name_en: String, pub month_name_en: String, // some fields omitted }
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.
Fields
day: usize
month: usize
month_len: usize
year: usize
day_name: String
month_name: String
day_gr: usize
month_gr: usize
year_gr: usize
day_name_en: String
month_name_en: String
Methods
impl HijriDate
[src]
impl HijriDate
pub fn from_hijri(year: usize, month: usize, day: usize) -> Self
[src]
pub fn from_hijri(year: usize, month: usize, day: usize) -> Self
get data from hijri date
pub fn from_gr(year_gr: usize, month_gr: usize, day_gr: usize) -> Self
[src]
pub fn from_gr(year_gr: usize, month_gr: usize, day_gr: usize) -> Self
get data from gregorian date.
pub fn today() -> Self
[src]
pub fn today() -> Self
get data from today's date.
pub fn format(&self, f: &str) -> String
[src]
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
impl Debug for HijriDate
[src]
impl Debug for HijriDate
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for HijriDate
[src]
impl PartialEq for HijriDate
fn eq(&self, other: &HijriDate) -> bool
[src]
fn eq(&self, other: &HijriDate) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &HijriDate) -> bool
[src]
fn ne(&self, other: &HijriDate) -> bool
This method tests for !=
.
impl Display for HijriDate
[src]
impl Display for HijriDate
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Add<Duration> for HijriDate
[src]
impl Add<Duration> for HijriDate
type Output = HijriDate
The resulting type after applying the +
operator.
fn add(self, other: Duration) -> HijriDate
[src]
fn add(self, other: Duration) -> HijriDate
Performs the +
operation.
impl Sub<Duration> for HijriDate
[src]
impl Sub<Duration> for HijriDate
type Output = HijriDate
The resulting type after applying the -
operator.
fn sub(self, other: Duration) -> HijriDate
[src]
fn sub(self, other: Duration) -> HijriDate
Performs the -
operation.
impl Sub<HijriDate> for HijriDate
[src]
impl Sub<HijriDate> for HijriDate
type Output = Duration
The resulting type after applying the -
operator.
fn sub(self, other: HijriDate) -> Duration
[src]
fn sub(self, other: HijriDate) -> Duration
Performs the -
operation.
impl PartialOrd for HijriDate
[src]
impl PartialOrd for HijriDate
fn partial_cmp(&self, other: &HijriDate) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &HijriDate) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
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 more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more