ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
icu4x::Date Class Reference

#include <Date.d.hpp>

Public Member Functions

std::unique_ptr< icu4x::Dateto_calendar (const icu4x::Calendar &calendar) const
 
std::unique_ptr< icu4x::IsoDateto_iso () const
 
int64_t to_rata_die () const
 
uint16_t day_of_year () const
 
uint8_t day_of_month () const
 
icu4x::Weekday day_of_week () const
 
uint8_t ordinal_month () const
 
std::string month_code () const
 
uint8_t month_number () const
 
bool month_is_leap () const
 
int32_t era_year_or_related_iso () const
 
int32_t extended_year () const
 
std::string era () const
 
uint8_t months_in_year () const
 
uint8_t days_in_month () const
 
uint16_t days_in_year () const
 
std::unique_ptr< icu4x::Calendarcalendar () const
 

Static Public Member Functions

static diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarErrorfrom_iso_in_calendar (int32_t iso_year, uint8_t iso_month, uint8_t iso_day, const icu4x::Calendar &calendar)
 
static diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarErrorfrom_codes_in_calendar (std::string_view era_code, int32_t year, std::string_view month_code, uint8_t day, const icu4x::Calendar &calendar)
 
static diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarErrorfrom_rata_die (int64_t rd, const icu4x::Calendar &calendar)
 
static diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::Rfc9557ParseErrorfrom_string (std::string_view v, const icu4x::Calendar &calendar)
 
static void operator delete (void *ptr)
 

Detailed Description

An ICU4X Date object capable of containing a date for any calendar.

See the Rust documentation for Date for more information.

Member Function Documentation

◆ calendar()

std::unique_ptr< icu4x::Calendar > icu4x::Date::calendar ( ) const
inline

Returns the Calendar object backing this date

See the Rust documentation for calendar for more information.

◆ day_of_month()

uint8_t icu4x::Date::day_of_month ( ) const
inline

Returns the 1-indexed day in the month for this date

See the Rust documentation for day_of_month for more information.

◆ day_of_week()

icu4x::Weekday icu4x::Date::day_of_week ( ) const
inline

Returns the day in the week for this day

See the Rust documentation for day_of_week for more information.

◆ day_of_year()

uint16_t icu4x::Date::day_of_year ( ) const
inline

Returns the 1-indexed day in the year for this date

See the Rust documentation for day_of_year for more information.

◆ days_in_month()

uint8_t icu4x::Date::days_in_month ( ) const
inline

Returns the number of days in the month represented by this date

See the Rust documentation for days_in_month for more information.

◆ days_in_year()

uint16_t icu4x::Date::days_in_year ( ) const
inline

Returns the number of days in the year represented by this date

See the Rust documentation for days_in_year for more information.

◆ era()

std::string icu4x::Date::era ( ) const
inline

Returns the era for this date, or an empty string

See the Rust documentation for era for more information.

Additional information: 1

◆ era_year_or_related_iso()

int32_t icu4x::Date::era_year_or_related_iso ( ) const
inline

Returns the year number in the current era for this date

For calendars without an era, returns the related ISO year.

See the Rust documentation for era_year_or_related_iso for more information.

Additional information: 1, 2, 3

◆ extended_year()

int32_t icu4x::Date::extended_year ( ) const
inline

Returns the extended year in the Date

See the Rust documentation for extended_year for more information.

◆ from_codes_in_calendar()

diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarError > icu4x::Date::from_codes_in_calendar ( std::string_view era_code,
int32_t year,
std::string_view month_code,
uint8_t day,
const icu4x::Calendar & calendar )
inlinestatic

Creates a new Date from the given codes, which are interpreted in the given calendar system

An empty era code will treat the year as an extended year

See the Rust documentation for try_new_from_codes for more information.

◆ from_iso_in_calendar()

diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarError > icu4x::Date::from_iso_in_calendar ( int32_t iso_year,
uint8_t iso_month,
uint8_t iso_day,
const icu4x::Calendar & calendar )
inlinestatic

Creates a new Date representing the ISO date given but in a given calendar

See the Rust documentation for new_from_iso for more information.

◆ from_rata_die()

diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::CalendarError > icu4x::Date::from_rata_die ( int64_t rd,
const icu4x::Calendar & calendar )
inlinestatic

Creates a new Date from the given Rata Die

See the Rust documentation for from_rata_die for more information.

◆ from_string()

diplomat::result< std::unique_ptr< icu4x::Date >, icu4x::Rfc9557ParseError > icu4x::Date::from_string ( std::string_view v,
const icu4x::Calendar & calendar )
inlinestatic

Creates a new Date from an IXDTF string.

See the Rust documentation for try_from_str for more information.

◆ month_code()

std::string icu4x::Date::month_code ( ) const
inline

Returns the month code for this date. Typically something like "M01", "M02", but can be more complicated for lunar calendars.

See the Rust documentation for standard_code for more information.

Additional information: 1

◆ month_is_leap()

bool icu4x::Date::month_is_leap ( ) const
inline

Returns whether the month is a leap month.

See the Rust documentation for is_leap for more information.

◆ month_number()

uint8_t icu4x::Date::month_number ( ) const
inline

Returns the month number of this month.

See the Rust documentation for month_number for more information.

◆ months_in_year()

uint8_t icu4x::Date::months_in_year ( ) const
inline

Returns the number of months in the year represented by this date

See the Rust documentation for months_in_year for more information.

◆ operator delete()

void icu4x::Date::operator delete ( void * ptr)
inlinestatic

◆ ordinal_month()

uint8_t icu4x::Date::ordinal_month ( ) const
inline

Returns 1-indexed number of the month of this date in its year

Note that for lunar calendars this may not lead to the same month having the same ordinal month across years; use month_code if you care about month identity.

See the Rust documentation for month for more information.

See the Rust documentation for ordinal for more information.

◆ to_calendar()

std::unique_ptr< icu4x::Date > icu4x::Date::to_calendar ( const icu4x::Calendar & calendar) const
inline

Convert this date to one in a different calendar

See the Rust documentation for to_calendar for more information.

◆ to_iso()

std::unique_ptr< icu4x::IsoDate > icu4x::Date::to_iso ( ) const
inline

Converts this date to ISO

See the Rust documentation for to_iso for more information.

◆ to_rata_die()

int64_t icu4x::Date::to_rata_die ( ) const
inline

Returns this date's Rata Die

See the Rust documentation for to_rata_die for more information.


The documentation for this class was generated from the following files: