GregorianCalendarDelegate class

A CalendarDelegate implementation for the Gregorian calendar system.

The Gregorian calendar is the most widely used civil calendar worldwide. This delegate provides standard date interpretation, formatting, and navigation based on the Gregorian system.

This delegate is the default calendar system for CalendarDatePicker.

See also:

Inheritance

Constructors

GregorianCalendarDelegate.new()
Creates a calendar delegate that uses the Gregorian calendar and the conventions of the current MaterialLocalizations.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDaysToDate(DateTime date, int days) DateTime
Returns a DateTime with the added number of days and time set to midnight.
override
addMonthsToMonthDate(DateTime monthDate, int monthsToAdd) DateTime
Returns a DateTime that is monthDate with the added number of months and the day set to 1 and time set to midnight.
override
dateHelpText(MaterialLocalizations localizations) String
The help text used on an empty InputDatePickerFormField to indicate to the user the date format being asked for.
override
dateOnly(DateTime date) DateTime
Returns a DateTime with the date of the original, but time set to midnight.
override
datesOnly(DateTimeRange<DateTime> range) DateTimeRange<DateTime>
Returns a DateTimeRange with the dates of the original, but with times set to midnight.
inherited
firstDayOffset(int year, int month, MaterialLocalizations localizations) int
Computes the offset from the first day of the week that the first day of the month falls on.
override
formatCompactDate(DateTime date, MaterialLocalizations localizations) String
Formats the date in a compact format.
override
formatFullDate(DateTime date, MaterialLocalizations localizations) String
Formats day of week, month, day of month and year in a long-width format.
override
formatMediumDate(DateTime date, MaterialLocalizations localizations) String
Formats the date using a medium-width format.
override
formatMonthYear(DateTime date, MaterialLocalizations localizations) String
Formats the month and the year of the given date.
override
formatShortDate(DateTime date, MaterialLocalizations localizations) String
Formats the date using a short-width format.
override
formatShortMonthDay(DateTime date, MaterialLocalizations localizations) String
Formats the month and day of the given date.
override
formatYear(int year, MaterialLocalizations localizations) String
Full unabbreviated year format, e.g. 2017 rather than 17.
inherited
getDay(int year, int month, int day) DateTime
Returns a DateTime with the given year, month, and day.
override
getDaysInMonth(int year, int month) int
Returns the number of days in a month, according to the proleptic Gregorian calendar.
override
getMonth(int year, int month) DateTime
Returns a DateTime with the given year and month.
override
isSameDay(DateTime? dateA, DateTime? dateB) bool
Returns true if the two DateTime objects have the same day, month, and year, or are both null.
inherited
isSameMonth(DateTime? dateA, DateTime? dateB) bool
Returns true if the two DateTime objects have the same month and year, or are both null.
inherited
monthDelta(DateTime startDate, DateTime endDate) int
Determines the number of months between two DateTime objects.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
now() DateTime
Returns a DateTime representing the current date and time.
override
parseCompactDate(String? inputString, MaterialLocalizations localizations) DateTime?
Converts the given compact date formatted string into a DateTime.
override
toString() String
A string representation of this object.
inherited

Operators

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