Initializer
Month(Integer integer)
Parameters:
  • integer

    Ordinal number of the month of year. Where:

    january = 1

    february = 2

    december = 12

Attributes
integerSource Codeshared Integer integer

Ordinal number of the month of year. Where:

january = 1

february = 2

december = 12

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Enumerable<Other>
Attributes inherited from: Ordinal<Other>
Methods
addSource Codeshared Overflow add(Integer numberOfMonths)

Adds number of months to this month and returns the result of as new month value and number of times the operation overflowed.

compareSource Codeshared actual Comparison compare(Month other)

Compares ordinal numbers of two instances of Month.

firstDayOfYearSource Codeshared default Integer firstDayOfYear(Boolean leapYear = false)

Returns the day of year value for first of this month.

Parameters:
  • leapYear = false
minusMonthsSource Codeshared Month minusMonths(Integer number)

Returns month of year that comes specified number of months before this month.

neighbourSource Codeshared actual Month neighbour(Integer offset)

returns n-th neighbour of this day of week.

For example:

assert(january.neighbour(0)  == january);
assert(january.neighbour(1)  == february);
assert(january.neighbour(-1) == december);
numberOfDaysSource Codeshared default Integer numberOfDays(Boolean leapYear = false)

Returns number of days in this month.

Parameters:
  • leapYear = false
offsetSource Codeshared actual default Integer offset(Month other)

Returns the offset of the other month compared to this.

This will always return positive integer such that given any two months a and b, the following is always true:

assert(0 <= a.offset(b) <= 11);

plusMonthsSource Codeshared Month plusMonths(Integer number)

Returns month of year that comes specified number of months after this month.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Comparable<Other>
Methods inherited from: Enumerable<Other>
Nested Classes
OverflowSource Codeshared Overflow

A result of adding or subtracting a month to another amount.