pub struct Roc;
Expand description
The Republic of China (ROC) Calendar
The Republic of China calendar is a solar calendar used in Taiwan and Penghu, as well as by overseas diaspora from
those locations. Months and days are identical to the Gregorian
calendar, while years are counted
with 1912, the year of the establishment of the Republic of China, as year 1 of the ROC/Minguo/民国/民國 era.
The Republic of China calendar should not be confused with the Chinese traditional lunar calendar
(see Chinese
).
Era codes
This calendar supports two era codes: "roc"
, corresponding to years in the 民國 (minguo) era (CE year 1912 and
after), and "roc-inverse"
, corresponding to years before the 民國 (minguo) era (CE year 1911 and before).
Month codes
This calendar supports 12 solar month codes ("M01" - "M12"
)
Trait Implementations§
source§impl Calendar for Roc
impl Calendar for Roc
source§fn any_calendar_kind(&self) -> Option<AnyCalendarKind>
fn any_calendar_kind(&self) -> Option<AnyCalendarKind>
The AnyCalendarKind
corresponding to this calendar
§type DateInner = RocDateInner
type DateInner = RocDateInner
source§fn date_from_codes(
&self,
era: Era,
year: i32,
month_code: MonthCode,
day: u8
) -> Result<<Roc as Calendar>::DateInner, CalendarError>
fn date_from_codes( &self, era: Era, year: i32, month_code: MonthCode, day: u8 ) -> Result<<Roc as Calendar>::DateInner, CalendarError>
source§fn date_from_iso(&self, iso: Date<Iso>) -> <Roc as Calendar>::DateInner
fn date_from_iso(&self, iso: Date<Iso>) -> <Roc as Calendar>::DateInner
source§fn date_to_iso(&self, date: &<Roc as Calendar>::DateInner) -> Date<Iso>
fn date_to_iso(&self, date: &<Roc as Calendar>::DateInner) -> Date<Iso>
source§fn months_in_year(&self, date: &<Roc as Calendar>::DateInner) -> u8
fn months_in_year(&self, date: &<Roc as Calendar>::DateInner) -> u8
source§fn days_in_year(&self, date: &<Roc as Calendar>::DateInner) -> u16
fn days_in_year(&self, date: &<Roc as Calendar>::DateInner) -> u16
source§fn days_in_month(&self, date: &<Roc as Calendar>::DateInner) -> u8
fn days_in_month(&self, date: &<Roc as Calendar>::DateInner) -> u8
source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
source§fn year(&self, date: &<Roc as Calendar>::DateInner) -> FormattableYear
fn year(&self, date: &<Roc as Calendar>::DateInner) -> FormattableYear
date
source§fn is_in_leap_year(&self, date: &<Roc as Calendar>::DateInner) -> bool
fn is_in_leap_year(&self, date: &<Roc as Calendar>::DateInner) -> bool
source§fn month(&self, date: &<Roc as Calendar>::DateInner) -> FormattableMonth
fn month(&self, date: &<Roc as Calendar>::DateInner) -> FormattableMonth
date
source§fn day_of_month(&self, date: &<Roc as Calendar>::DateInner) -> DayOfMonth
fn day_of_month(&self, date: &<Roc as Calendar>::DateInner) -> DayOfMonth
date
source§fn day_of_year_info(&self, date: &<Roc as Calendar>::DateInner) -> DayOfYearInfo
fn day_of_year_info(&self, date: &<Roc as Calendar>::DateInner) -> DayOfYearInfo
source§fn day_of_week(&self, date: &Self::DateInner) -> IsoWeekday
fn day_of_week(&self, date: &Self::DateInner) -> IsoWeekday
source§impl CldrCalendar for Roc
impl CldrCalendar for Roc
source§const DEFAULT_BCP_47_IDENTIFIER: Value = _
const DEFAULT_BCP_47_IDENTIFIER: Value = _
§type DateSymbolsV1Marker = RocDateSymbolsV1Marker
type DateSymbolsV1Marker = RocDateSymbolsV1Marker
§type DateLengthsV1Marker = RocDateLengthsV1Marker
type DateLengthsV1Marker = RocDateLengthsV1Marker
source§impl IntoAnyCalendar for Roc
impl IntoAnyCalendar for Roc
source§fn to_any(self) -> AnyCalendar
fn to_any(self) -> AnyCalendar
AnyCalendar
, moving it Read moresource§fn to_any_cloned(&self) -> AnyCalendar
fn to_any_cloned(&self) -> AnyCalendar
AnyCalendar
, cloning it Read moresource§fn date_to_any(&self, d: &<Roc as Calendar>::DateInner) -> AnyDateInner
fn date_to_any(&self, d: &<Roc as Calendar>::DateInner) -> AnyDateInner
AnyDateInner
Read more