Abstract
Protected
constructorPrivate
_dayPrivate
_monthThe month-of-year.
Private
_yearThe year.
Abstract
typeThe type of calendar.
Gets the day-of-month field.
This method returns the primitive int
value for the day-of-month.
the day-of-month, from 1 to 31
Returns the day of week, taking account of the weekOfMonth.
This returns the day of week of current day. For example, a day placed in Sunday would return 0.
Gets the day-of-year field.
This method returns the primitive int
value for the day-of-year.
the day-of-year, from 1 to 365, or 366 in a leap year
Returns the length of the month, taking account of the year.
This returns the length of the month in days. For example, a date in January would return 31.
the length of the month in days, from 28 to 31
Returns the length of the year.
This returns the length of the year in days, either 365 or 366.
366 if the year is leap, 365 otherwise
Gets the name of month-of-year.
This method returns the month name as an String
.
the name of month-of-year
Gets the month-of-year field from 1 to 12.
This method returns the month as an int
from 1 to 12.
Application code is frequently clearer if the enum [Month]
is used by calling [.getMonth].
the month-of-year, from 1 to 12
Private
addChecks if this date is after the specified date.
This checks to see if this date represents a point on the local time-line after the other date.
const a = ILocalDate.ofBS(2077, 6, 20) const b = ILocalDate.ofBS(2077, 7, 1) a.after(b) == false a.after(a) == false b.after(a) == true
true if this date is after the specified date
the other date to compare to, not null
Checks if this date is before the specified date.
This checks to see if this date represents a point on the local time-line before the other date.
const a = ILocalDate.ofBS(2077, 6, 20) const b = ILocalDate.ofBS(2077, 7, 1) a.before(b) == true a.before(a) == false b.before(a) == false
This method only considers the position of the two dates on the local time-line. It does not take into account the chronology, or calendar system. This is different from the comparison in [#compareTo(ChronoLocalDate)](../modules.html), but is the same approach as ChronoLocalDate#timeLineOrder().
true if this date is before the specified date
the other date to compare to, not null
Private
checkPrivate
checkCompares this date to another date.
The comparison is primarily based on the date, from earliest to latest. It is "consistent with equals", as defined by Comparable.
If all the dates being compared are instances of {@code ILocalDate}, then the comparison will be entirely based on the date.
the comparator value, negative if less, positive if greater
the other date to compare to, not null
Checks if this date is equal to another date.
Compares this {@code ILocalDate} with another ensuring that the date is the same.
Only objects of type {@code ILocalDate} are compared, other types return false.
true if this is equal to the other date
Optional
other: objectthe object to check, null returns false
Protected
Abstract
firstA hash code for this date.
a suitable hash code
Private
instanceProtected
Abstract
maxProtected
Abstract
minReturns a copy of this {@code ILocalDate} with the specified number of days subtracted.
This method subtracts the specified amount from the days field decrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded.
For example, 2009-01-01 minus one day would result in 2008-12-31.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the days subtracted
the days to subtract, may be negative
Returns a copy of this {@code ILocalDate} with the specified number of months subtracted.
This method subtracts the specified amount from the months field in three steps:
For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the months subtracted
the months to subtract, may be negative
Returns a copy of this {@code ILocalDate} with the specified number of years subtracted.
This method subtracts the specified amount from the years field in three steps:
For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2007-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the years subtracted
the years to subtract, may be negative
Returns a copy of this {@code ILocalDate} with the specified number of days added.
This method adds the specified amount to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded.
For example, 2008-12-31 plus one day would result in 2009-01-01.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the days added
the days to add, may be negative
Returns a copy of this {@code ILocalDate} with the specified number of months added.
This method adds the specified amount to the months field in three steps:
For example, 2007-03-31 plus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the months added
the months to add, may be negative
Returns a copy of this {@code ILocalDate} with the specified number of years added.
This method adds the specified amount to the years field in three steps:
For example, 2008-02-29 (leap year) plus one year would result in the invalid date 2009-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2009-02-28, is selected instead.
This instance is immutable and unaffected by this method call.
a {@code ILocalDate} based on this date with the years added
the years to add, may be negative
Protected
Abstract
referenceReturns the start week of month, taking account of the weekOfMonth.
This returns the start weekDay of current month. For example, a month started with Sunday would return 0.
the starting day of month
Private
subtractOutputs this date as a {@code String}, such as {@code 2007-12-03 (BS)}.
The output will be in the ISO-8601 format {@code uuuu-MM-dd}.
a string representation of this date, not null
Static
convertStatic
convertStatic
newStatic
nowADStatic
nowBSStatic
ofObtains an instance of {@code ILocalDate} from a year, month and day.
This returns a {@code ILocalDate} with the specified year, month and day-of-month. The day must be valid for the year and month, otherwise an exception will be thrown.
the local date, not null
the year to represent, from MIN_YEAR to MAX_YEAR
the month-of-year to represent, from 1 (January) to 12 (December)
the day-of-month to represent, from 1 to 31
the type of calendar to represent by AD or BS
Static
ofADStatic
ofBSStatic
ofGenerated using TypeDoc
The day-of-month.