ChineseTraditional

Type Alias ChineseTraditional 

Source
pub type ChineseTraditional = EastAsianTraditional<China>;
Expand description

The Chinese variant of the EastAsianTraditional calendar.

This type agrees with the official data published by the Purple Mountain Observatory for the years 1900-2025, as well as with the data published by the Hong Kong Observatory for the years 1901-2100.

For years since 1912, this uses the GB/T 33661-2017 rules. As accurate computation is computationally expensive, years until 2100 are precomputed, and after that this type regresses to a simplified calculation. If accuracy beyond 2100 is required, clients can implement their own [Rules] type containing more precomputed data. We note that the calendar is inherently uncertain for some future dates.

Before 1912 different rules were used. This type produces correct data for the years 1900-1912, and falls back to a simplified calculation before 1900. If accuracy is required before 1900, clients can implement their own [Rules] type using data such as from the excellent compilation by Yuk Tung Liu.

The precise behavior of this calendar may change in the future if:

  • New ground truth is established by published government sources
  • We decide to tweak the simplified calculation
  • We decide to expand or reduce the range where we are correctly handling past dates.

Aliased Type§

pub struct ChineseTraditional(pub China);

Tuple Fields§

§0: China

Implementations§

Source§

impl ChineseTraditional

Source

pub const fn new() -> Self

Creates a new ChineseTraditional calendar.

Source

pub fn try_new_with_buffer_provider( _provider: &(impl BufferProvider + ?Sized), ) -> Result<Self, DataError>

👎Deprecated since 2.1.0: use `Self::new()

A version of Self::new that uses custom data provided by a BufferProvider.

Enabled with the serde feature.

📚 Help choosing a constructor

Source

pub fn try_new_unstable<D: ?Sized>(_provider: &D) -> Result<Self, DataError>

👎Deprecated since 2.1.0: use `Self::new()

A version of Self::new that uses custom data provided by a DataProvider.

📚 Help choosing a constructor

⚠️ The bounds on provider may change over time, including in SemVer minor releases.
Source

pub fn new_always_calculating() -> Self

👎Deprecated since 2.1.0: use `Self::new()

Trait Implementations§

Source§

impl IntoAnyCalendar for ChineseTraditional

Source§

fn to_any(self) -> AnyCalendar

Convert this calendar into an AnyCalendar, moving it Read more
Source§

fn kind(&self) -> AnyCalendarKind

The AnyCalendarKind enum variant associated with this calendar
Source§

fn from_any(any: AnyCalendar) -> Result<Self, AnyCalendar>

Move an AnyCalendar into a Self, or returning it as an error if the types do not match. Read more
Source§

fn from_any_ref(any: &AnyCalendar) -> Option<&Self>

Convert an AnyCalendar reference into a Self reference. Read more
Source§

fn date_to_any(&self, d: &Self::DateInner) -> AnyDateInner

Convert a date for this calendar into an AnyDateInner Read more