pub struct ISO { /* private fields */ }
Expand description
Represents a date in the ISO-8601 week-date calendar
This is essentially an alternative naming system for Gregorian dates.
Despite being derived from the Gregorian calendar, the ISO-8601 has a different year start and year end than the Gregorian. If the Gregorian year X ends in the middle of the ISO week, the next days may be in Gregorian year X+1 and ISO year X.
§Further reading
- Wikipedia
- Rachel by the Bay
- describes the confusion of intermingling documentation for ISO and Gregorian dates
Implementations§
Source§impl ISO
impl ISO
Sourcepub fn try_new(year: i32, week: u8, day: Weekday) -> Result<Self, CalendarError>
pub fn try_new(year: i32, week: u8, day: Weekday) -> Result<Self, CalendarError>
Attempt to create a new ISO week date
pub fn year(self) -> i32
pub fn week(self) -> NonZero<u8>
Sourcepub fn day(self) -> Weekday
pub fn day(self) -> Weekday
Note that the numeric values of the Weekday enum are not consistent with ISO-8601. Use day_num for the numeric day number.
pub fn new_year(year: i32) -> Self
Trait Implementations§
Source§impl HasLeapYears for ISO
impl HasLeapYears for ISO
Source§impl PartialOrd for ISO
impl PartialOrd for ISO
Source§impl PresetDisplay for ISO
impl PresetDisplay for ISO
Source§fn short_date(&self) -> String
fn short_date(&self) -> String
Format a date in a calendar-specific short format
Source§fn supported_display_lang(lang: Language) -> bool
fn supported_display_lang(lang: Language) -> bool
Checks if language is supported
Source§fn preset_str(&self, lang: Language, preset: PresetFormat<'_>) -> String
fn preset_str(&self, lang: Language, preset: PresetFormat<'_>) -> String
Format a date in any
PresetFormat
impl AllowYearZero for ISO
impl CalculatedBounds for ISO
impl Copy for ISO
impl DisplayMomentItem for ISO
impl StructuralPartialEq for ISO
Auto Trait Implementations§
impl Freeze for ISO
impl RefUnwindSafe for ISO
impl Send for ISO
impl Sync for ISO
impl Unpin for ISO
impl UnwindSafe for ISO
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