LocalDateMethods

final implicit class LocalDateMethods(date: LocalDate) extends AnyVal

Provides extension methods for java.time.LocalDate

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def +(days: Long): LocalDate

Gets date with specified number of days added.

Gets date with specified number of days added.

Value parameters:
days

number of days

def +(amount: TemporalAmount): LocalDate

Gets date with specified amount added.

Gets date with specified amount added.

Value parameters:
amount

temporal amount

def -(days: Long): LocalDate

Gets date with specified number of days subtracted.

Gets date with specified number of days subtracted.

Value parameters:
days

number of days

def -(amount: TemporalAmount): LocalDate

Gets date with specified amount subtracted.

Gets date with specified amount subtracted.

Value parameters:
amount

temporal amount

def atEndOfMonth: LocalDate

Gets date adjusted to last day of month.

Gets date adjusted to last day of month.

def atEndOfWeek: LocalDate

Gets date adjusted to last day of week.

Gets date adjusted to last day of week.

Note:

Saturday is last day of week.

def atEndOfWeek(lastDay: DayOfWeek): LocalDate

Gets date adjusted to last day of week.

Gets date adjusted to last day of week.

Value parameters:
lastDay

last day of week

def atEndOfYear: LocalDate

Gets date adjusted to last day of year.

Gets date adjusted to last day of year.

def atStartOfMonth: LocalDate

Gets date adjusted to first day of month.

Gets date adjusted to first day of month.

def atStartOfWeek: LocalDate

Gets date adjusted to first day of week.

Gets date adjusted to first day of week.

Note:

Sunday is first day of week.

def atStartOfWeek(firstDay: DayOfWeek): LocalDate

Gets date adjusted to specified first day of week.

Gets date adjusted to specified first day of week.

Value parameters:
firstDay

first day of week

def atStartOfYear: LocalDate

Gets date adjusted to first day of year.

Gets date adjusted to first day of year.

def iterateTo(end: LocalDate, step: Period): Iterator[LocalDate]

Creates iterator to end date (inclusive).

Creates iterator to end date (inclusive).

Value parameters:
end

end date

step

period by which to step

Throws:
IllegalArgumentException

if step is zero.

def iterateUntil(end: LocalDate, step: Period): Iterator[LocalDate]

Creates iterator to end date (exclusive).

Creates iterator to end date (exclusive).

Value parameters:
end

end date

step

period by which to step

def max(other: LocalDate): LocalDate

Compares to other date and returns the greater value.

Compares to other date and returns the greater value.

Value parameters:
other

other date

def min(other: LocalDate): LocalDate

Compares to other date and returns the lesser value.

Compares to other date and returns the lesser value.

Value parameters:
other

other date

def toYearMonth: YearMonth

Gets YearMonth part of date.

Gets YearMonth part of date.