Struct icu::calendar::japanese::JapaneseExtended
source · pub struct JapaneseExtended(_);
Expand description
The Japanese Calendar (with historical eras)
The Japanese calendar is a solar calendar used in Japan, with twelve months. The months and days are identical to that of the Gregorian calendar, however the years are counted differently using the Japanese era system.
This type can be used with Date
or DateTime
to represent dates in this calendar.
Era codes
This calendar supports a large number of era codes. It supports the five post-Meiji eras
("meiji"
, "taisho"
, "showa"
, "heisei"
, "reiwa"
). Pre-Meiji eras are represented
with their names converted to lowercase ascii and followed by their start year. E.g. the “Ten’ō”
era (781 - 782 CE) has the code "teno-781"
. The Gregorian "bce"
and "ce"
eras
are used for dates before the first known era era.
These eras are loaded from data, requiring a data provider capable of providing JapaneseExtendedErasV1Marker
data (calendar/japanext@1
).
Implementations§
source§impl JapaneseExtended
impl JapaneseExtended
sourcepub fn try_new_unstable<D>(
data_provider: &D
) -> Result<JapaneseExtended, CalendarError>where
D: DataProvider<JapaneseExtendedErasV1Marker> + ?Sized,
pub fn try_new_unstable<D>( data_provider: &D ) -> Result<JapaneseExtended, CalendarError>where D: DataProvider<JapaneseExtendedErasV1Marker> + ?Sized,
Creates a new Japanese
from locale data using all eras (including pre-meiji).
sourcepub fn try_new_with_any_provider(
provider: &impl AnyProvider
) -> Result<JapaneseExtended, CalendarError>
pub fn try_new_with_any_provider( provider: &impl AnyProvider ) -> Result<JapaneseExtended, CalendarError>
Creates a new instance using an AnyProvider
.
For details on the behavior of this function, see: Self::try_new_unstable
sourcepub fn try_new_with_buffer_provider(
provider: &impl BufferProvider
) -> Result<JapaneseExtended, CalendarError>
pub fn try_new_with_buffer_provider( provider: &impl BufferProvider ) -> Result<JapaneseExtended, CalendarError>
✨ Enabled with the "serde"
feature.
Creates a new instance using a BufferProvider
.
For details on the behavior of this function, see: Self::try_new_unstable
Trait Implementations§
source§impl Calendar for JapaneseExtended
impl Calendar for JapaneseExtended
source§fn year(
&self,
date: &<JapaneseExtended as Calendar>::DateInner
) -> FormattableYear
fn year( &self, date: &<JapaneseExtended as Calendar>::DateInner ) -> FormattableYear
The calendar-specific year represented by date
source§fn month(
&self,
date: &<JapaneseExtended as Calendar>::DateInner
) -> FormattableMonth
fn month( &self, date: &<JapaneseExtended as Calendar>::DateInner ) -> FormattableMonth
The calendar-specific month represented by date
source§fn day_of_month(
&self,
date: &<JapaneseExtended as Calendar>::DateInner
) -> DayOfMonth
fn day_of_month( &self, date: &<JapaneseExtended as Calendar>::DateInner ) -> DayOfMonth
The calendar-specific day-of-month represented by date
source§fn day_of_year_info(
&self,
date: &<JapaneseExtended as Calendar>::DateInner
) -> DayOfYearInfo
fn day_of_year_info( &self, date: &<JapaneseExtended as Calendar>::DateInner ) -> DayOfYearInfo
Information of the day of the year
§type DateInner = JapaneseDateInner
type DateInner = JapaneseDateInner
source§fn date_from_codes(
&self,
era: Era,
year: i32,
month_code: MonthCode,
day: u8
) -> Result<<JapaneseExtended as Calendar>::DateInner, CalendarError>
fn date_from_codes( &self, era: Era, year: i32, month_code: MonthCode, day: u8 ) -> Result<<JapaneseExtended as Calendar>::DateInner, CalendarError>
source§fn date_from_iso(&self, iso: Date<Iso>) -> JapaneseDateInner
fn date_from_iso(&self, iso: Date<Iso>) -> JapaneseDateInner
source§fn date_to_iso(
&self,
date: &<JapaneseExtended as Calendar>::DateInner
) -> Date<Iso>
fn date_to_iso( &self, date: &<JapaneseExtended as Calendar>::DateInner ) -> Date<Iso>
source§fn months_in_year(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u8
fn months_in_year(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u8
source§fn days_in_year(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u32
fn days_in_year(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u32
source§fn days_in_month(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u8
fn days_in_month(&self, date: &<JapaneseExtended as Calendar>::DateInner) -> u8
source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
source§fn any_calendar_kind(&self) -> Option<AnyCalendarKind>
fn any_calendar_kind(&self) -> Option<AnyCalendarKind>
AnyCalendarKind
corresponding to this calendar,
if one exists. Implementors outside of icu_calendar should return Nonesource§fn day_of_week(&self, date: &Self::DateInner) -> IsoWeekday
fn day_of_week(&self, date: &Self::DateInner) -> IsoWeekday
source§impl CldrCalendar for JapaneseExtended
impl CldrCalendar for JapaneseExtended
source§const DEFAULT_BCP_47_IDENTIFIER: Value = {
const R: ::icu_locid::extensions::unicode::Value =
::icu_locid::extensions::unicode::Value::from_tinystr(match ::icu_locid::extensions::unicode::Value::subtag_from_bytes("japanext".as_bytes())
{
Ok(r) => r,
_ =>
::core::panicking::panic_fmt(<#[lang = "format_arguments"]>::new_const(&["Invalid Unicode extension value: japanext"])),
});
R
}
const DEFAULT_BCP_47_IDENTIFIER: Value = { const R: ::icu_locid::extensions::unicode::Value = ::icu_locid::extensions::unicode::Value::from_tinystr(match ::icu_locid::extensions::unicode::Value::subtag_from_bytes("japanext".as_bytes()) { Ok(r) => r, _ => ::core::panicking::panic_fmt(<#[lang = "format_arguments"]>::new_const(&["Invalid Unicode extension value: japanext"])), }); R }
§type DateSymbolsV1Marker = JapaneseExtendedDateSymbolsV1Marker
type DateSymbolsV1Marker = JapaneseExtendedDateSymbolsV1Marker
§type DateLengthsV1Marker = JapaneseExtendedDateLengthsV1Marker
type DateLengthsV1Marker = JapaneseExtendedDateLengthsV1Marker
source§impl Clone for JapaneseExtended
impl Clone for JapaneseExtended
source§fn clone(&self) -> JapaneseExtended
fn clone(&self) -> JapaneseExtended
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for JapaneseExtended
impl Debug for JapaneseExtended
source§impl Default for JapaneseExtended
impl Default for JapaneseExtended
source§fn default() -> JapaneseExtended
fn default() -> JapaneseExtended
source§impl IntoAnyCalendar for JapaneseExtended
impl IntoAnyCalendar for JapaneseExtended
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: &<JapaneseExtended as Calendar>::DateInner
) -> AnyDateInner
fn date_to_any( &self, d: &<JapaneseExtended as Calendar>::DateInner ) -> AnyDateInner
AnyDateInner
Read more