Initializer
GregorianDate(Integer dayOfEra)
Parameters:
  • dayOfEra

    Every Date implementation should indicate it´s own day of era based in it´s own chronology.

Attributes
daySource Codeshared actual Integer day

Returns day of month value of this gregorian date.

dayOfEraSource Codeshared actual Integer dayOfEra

Every Date implementation should indicate it´s own day of era based in it´s own chronology.

dayOfWeekSource Codeshared actual DayOfWeek dayOfWeek

Returns current day of the week.

dayOfYearSource Codeshared actual Integer dayOfYear

Returns day of year value of this gregorian date.

leapYearSource Codeshared actual Boolean leapYear

Returns true, if this is a leap year according to gregorian calendar leap year rules.

monthSource Codeshared actual Month month

Returns month of this gregorian date.

predecessorSource Codeshared actual Date predecessor

Returns gregorian date immediately preceding this date.

For successor its used the lowest unit of date, this way we can benefit from maximum precision. In this case the successor is the current value minus 1 day.

Refines Enumerable.predecessor ultimately refines Ordinal.predecessor
stringSource Codeshared actual String string

Returns ISO-8601 formatted String representation of this date.

Reference: https://en.wikipedia.org/wiki/ISO_8601#Dates

successorSource Codeshared actual Date successor

Returns gregorian date immediately succeeding this date.

For successor its used the lowest unit of date, this way we can benefit from maximum precision. In this case the successor is the current value plus 1 day.

Refines Enumerable.successor ultimately refines Ordinal.successor
weekOfYearSource Codeshared actual Integer weekOfYear

Returns week of year according to ISO-8601 week number calculation rules.

yearSource Codeshared actual Integer year

Returns year of this gregorian date.

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Date
Attributes inherited from: Enumerable<Other>
Attributes inherited from: Ordinal<Other>
Attributes inherited from: ReadableDate
Attributes inherited from: ReadableMonth
Attributes inherited from: ReadableYear
Methods
atSource Codeshared actual DateTime at(Time time)

Returns new DateTime value.

Refines Date.at
compareSource Codeshared actual Comparison compare(Date other)

Dates from same chronology can be compared if they have same day of era.

minusSource Codeshared actual Date minus(ReadableDatePeriod amount)

Subtracts specified date period from this date and returns the new Date.

Refines Date.minus
minusDaysSource Codeshared actual Date minusDays(Integer days)

Subtracts number of days from this date and returns the resulting Date.

minusMonthsSource Codeshared actual Date minusMonths(Integer months)

Subtracts number of months from this date and returns the resulting date.

Note: Day of month value of the resulting date will be truncated to the valid range of the target date if necessary.

This means for example, that date(2013, 3, 30).minusMonths(1) will return 2013-02-28, since February 2013 has only 28 days.

minusWeeksSource Codeshared actual Date minusWeeks(Integer weeks)

Subtracts number of weeks from this date and returns the resulting Date.

minusYearsSource Codeshared actual Date minusYears(Integer years)

Subtracts number of years from this date returning the resulting the new gregorian date.

Note: Day of month value of the resulting date will be truncated to the valid range of the target date if necessary.

This means for example, that date(2012, 2, 29).minusYears(1) will return 2011-02-28, since February 2011 has only 28 days.

neighbourSource Codeshared actual Date neighbour(Integer offset)

The indirect successor or predecessor at the given offset, where:

  • x.neighbour(0) == x,
  • x.neighbour(i+1) == x.neighbour(i).successor, and
  • x.neighbour(i-1) == x.neighbour(i).predecessor.
offsetSource Codeshared actual Integer offset(Date other)

Compute the offset from the given value, where:

  • x.offset(x) == 0, and
  • x.successor.offset(x) == 1 if x!=x.successor.
periodFromSource Codeshared actual Period periodFrom(Date start)

Returns the period between this and the given date.

If this date is before the given date then return negative period.

periodToSource Codeshared actual Period periodTo(Date end)

Returns the period between this and the given date.

If this date is after the given date then return negative period.

plusSource Codeshared actual Date plus(ReadableDatePeriod amount)

Adds specified date period to this date and returns the new Date.

Refines Date.plus
plusDaysSource Codeshared actual Date plusDays(Integer days)

Adds number of days to this date and returns the resulting Date.

plusMonthsSource Codeshared actual Date plusMonths(Integer months)

Adds number of months to this date and returns the resulting date.

Note: Day of month value of the resulting date will be truncated to the valid range of the target date if necessary.

This means for example, that date(2013, 1, 31).plusMonths(1) will return 2013-02-28, since February 2013 has only 28 days.

plusWeeksSource Codeshared actual Date plusWeeks(Integer weeks)

Adds number of weeks to this date and returns the resulting Date.

plusYearsSource Codeshared actual Date plusYears(Integer years)

Adds number of years to this date returning the resulting gregorian date.

Note: Day of month value of the resulting date will be truncated to the valid range of the target date if necessary.

This means for example, that date(2012, 2, 29).plusYears(1) will return 2013-02-28, since February 2013 has only 28 days.

rangeToSource Codeshared actual DateRange rangeTo(Date other)

Returns the DateRange between this and given Date.

Refines Date.rangeTo
withDaySource Codeshared actual Date withDay(Integer day)

Returns new date with the day of month value set to the specified value.

Note: It should result in a valid gregorian date.

withDayOfWeekSource Codeshared actual Date withDayOfWeek(DayOfWeek dayOfWeek)

Returns a copy of this period with the specified day of week.

withDayOfYearSource Codeshared actual Date withDayOfYear(Integer dayOfYear)

Returns a copy of this period with the specified day of year.

withMonthSource Codeshared actual Date withMonth(Month month)

Returns new date with the month set to the specified value.

Note: It should result in a valid gregorian date.

withWeekOfYearSource Codeshared actual Date withWeekOfYear(Integer weekOfYear)

Returns new date with the specified weekOfYear value.

Note: It should result in a valid gregorian date.

withYearSource Codeshared actual Date withYear(Integer year)

Returns new date with the specified year value.

Note: It should result in a valid gregorian date.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Comparable<Other>
Methods inherited from: Date
Methods inherited from: DateBehavior<Element>
Methods inherited from: Enumerable<Other>
Methods inherited from: MonthBehavior<Element>
Methods inherited from: YearBehavior<Element>