Date<T extends DateAdapter<AbstractDate>> class

Inheritance

Constructors

Date(int year, [int month = 1, int day = 1])
///////////////////////////////////////////////////////////////////////////
const
Date.fromAbstractDate(AbstractDate abstractDate)
constructs a new Date from another instance of an AbstractDate
factory
Date.fromDateTime(DateTime dt)
creates a new Date from a DateTime converted to DateType of T
factory
Date.now()
creates a new Date with the current date converted to date type of T
factory

Properties

adapter DateAdapter<AbstractDate>
returns the DateAdapter that is used for this date.
no setter
dateTime DateTime
converts the Date of type T to a dart DateTime
no setter
day int
finalinherited
formatted FormattedDate
returns a new instance of FormattedDate for the Date that can be helpful for making formatted dates.
no setter
formatter DateFormatter
returns the DateAdapter as a DateFormatter if it implements the DateFormatter mixin.
no setter
hashCode int
The hash code for this object.
no setterinherited
month int
finalinherited
monthLength int
return the month length based on year and month using the dates adapter
no setter
monthName String
returns the month name that is specified in the DateAdapter's DateFormatter.
no setter
nWeekDay int
normalized week day where first weekDay is 1 and last week day is 7
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tomorrow Date<DateAdapter<AbstractDate>>
the day after this date
no setter
week Week
the week containing this date
no setter
weekDay int
gives the weekDay from dart's DateTime
no setter
weekDayName String
returns the weekday name that is specified in the DateAdapter's DateFormatter.
no setter
year int
finalinherited
yesterday Date<DateAdapter<AbstractDate>>
the day before this date
no setter

Methods

add(int days) Date<T>
added a the number of days of the Duration to a new Date
as<A extends DateAdapter<AbstractDate>>() Date<A>
compareTo(AbstractDate<T> other) int
Compares this object to another object.
inherited
copy({int? year, int? month, int? day}) Date<T>
creates a new Date but with the optional parameter overrides.
difference(Date<DateAdapter<AbstractDate>> other) Duration
the difference between two Dates as a duration.
formatBuilder(String builder(FormattedDate d)) String
creates a formatted string with the help of a FormattedDate and a builder function.
getMonth() Month
the month containing this date
getYear() Year
the Year containing this date
isTypeOf<A extends DateAdapter<AbstractDate>>() bool
returns true if type of this Date is A
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
to<A extends DateAdapter<AbstractDate>>() Date<A>
converts this Date of Type T to a new Date of type A
toString() String
A string representation of this object.
override

Operators

operator <(dynamic other) bool
operator <=(dynamic other) bool
operator ==(Object other) bool
The equality operator.
inherited
operator >(dynamic other) bool
operator >=(dynamic other) bool

Static Methods

addType<A extends DateAdapter<AbstractDate>>(DateAdapter<AbstractDate> dateAdapter) → void
used to add new DateAdapters to Date
clearTypes() → void
removes all registered types
getAdapterOfType<A extends DateAdapter<AbstractDate>>() DateAdapter<AbstractDate>
returns the adapter registered under the A type
getAdapterWithId(String id) DateAdapter<AbstractDate>
returns the adapter with the same id.
removeType<A extends DateAdapter<AbstractDate>>() → void
removes the adapter registered under the A type
renameType<OLD extends DateAdapter<AbstractDate>, NEW extends DateAdapter<AbstractDate>>() → void
moves an adapter from being registered under the OLD type to the NEW type