pub enum Year {
Calendar,
WeekOf,
}
Expand description
An enum for the possible symbols of a year field in a date pattern.
Variants§
Calendar
Field symbol for calendar year (numeric).
In most cases the length of this field specifies the minimum number of digits to display, zero-padded as necessary. For most use cases, Year::Calendar
or Year::WeekOf
should be adequate.
This field symbol is represented by the character y
in a date formatting pattern string.
For more details, see documentation on date field symbols.
WeekOf
Field symbol for year in “week of year”.
This works for “week of year” based calendars in which the year transition occurs on a week boundary; may differ from calendar year Year::Calendar
near a year transition. This numeric year designation is used in conjunction with Week::WeekOfYear
, but can be used in non-Gregorian based calendar systems where week date processing is desired. The field length is interpreted in the same way as for Year::Calendar
.
This field symbol is represented by the character Y
in a date formatting pattern string.
For more details, see documentation on date field symbols.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Year
impl<'de> Deserialize<'de> for Year
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Year, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Year, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl From<Year> for FieldSymbol
impl From<Year> for FieldSymbol
source§fn from(input: Year) -> FieldSymbol
fn from(input: Year) -> FieldSymbol
source§impl Ord for Year
impl Ord for Year
source§impl PartialEq<Year> for Year
impl PartialEq<Year> for Year
source§impl PartialOrd<Year> for Year
impl PartialOrd<Year> for Year
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more