Date class final

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

See the Rust documentation for Date for more information.

Implemented types

Constructors

Date.fromCodesInCalendar(String eraCode, int year, String monthCode, int day, Calendar calendar)
Creates a new Date from the given codes, which are interpreted in the given calendar system
factory
Date.fromIsoInCalendar(int isoYear, int isoMonth, int isoDay, Calendar calendar)
Creates a new Date representing the ISO date given but in a given calendar
factory
Date.fromRataDie(int rd, Calendar calendar)
Creates a new Date from the given Rata Die
factory
Date.fromString(String v, Calendar calendar)
Creates a new Date from an IXDTF string.
factory

Properties

calendar Calendar
Returns the Calendar object backing this date
no setter
dayOfMonth int
Returns the 1-indexed day in the month for this date
no setter
dayOfWeek Weekday
Returns the day in the week for this day
no setter
dayOfYear int
Returns the 1-indexed day in the year for this date
no setter
daysInMonth int
Returns the number of days in the month represented by this date
no setter
daysInYear int
Returns the number of days in the year represented by this date
no setter
era String
Returns the era for this date, or an empty string
no setter
eraYearOrRelatedIso int
Returns the year number in the current era for this date
no setter
extendedYear int
Returns the extended year in the Date
no setter
hashCode int
The hash code for this object.
no setterinherited
monthCode String
Returns the month code for this date. Typically something like "M01", "M02", but can be more complicated for lunar calendars.
no setter
monthIsLeap bool
Returns whether the month is a leap month.
no setter
monthNumber int
Returns the month number of this month.
no setter
monthsInYear int
Returns the number of months in the year represented by this date
no setter
ordinalMonth int
Returns 1-indexed number of the month of this date in its year
no setter
rataDie int
Returns this date's Rata Die
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCalendar(Calendar calendar) Date
Convert this date to one in a different calendar
toIso() IsoDate
Converts this date to ISO
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited