Year

opaque type Year

Calendar Year

Year is an opaque Int value, holding literally the year number

Source
Year.scala

Def

@scala.annotation.targetName("plus")
inline def +(inline i: Int): Year

Get further in sequance

Get further in sequance

Returns value, which is given number of position further in sequence

Inherited from
_methods
Source
Sequential.scala
@scala.annotation.targetName("minus")
inline def -(inline i: Int): Year

Get before in sequance

Get before in sequance

Returns value, which is given number of position before in sequence

Inherited from
_methods
Source
Sequential.scala
@scala.annotation.targetName("less")
inline def <(inline v: A): Boolean

Less

Less

Returns true if current value is less than given, false - otherwise

Inherited from
_methods
Source
Ordered.scala
@scala.annotation.targetName("lessOrEqual")
inline def <=(inline v: A): Boolean

Less or equal

Less or equal

Returns true if current value is less or equal to given, false - otherwise

Inherited from
_methods
Source
Ordered.scala
@scala.annotation.targetName("range")
inline def <>(inline to: Int.G.<>[Year]

Range

Range

Returns Range from current to given value

Note. Range uses base primitive natural ordering

Inherited from
zMethodsBase
Source
Ordered.scala
@scala.annotation.targetName("rangeOfSize")
inline def <>=(inline sz: Int): Int.G.<>[Year]
Inherited from
zMethodsBase
Source
Ordered.scala
@scala.annotation.targetName("rangeX")
inline def <>>(inline to: Int.G.<>[Year]

Exclusive end range

Exclusive end range

Returns Range from current to given value exclusive

Note. Range uses base primitive natural ordering

Inherited from
zMethodsBase
Source
Ordered.scala
@scala.annotation.targetName("greater")
inline def >(inline v: A): Boolean

Greater

Greater

Returns true if current value is greater than given, false - otherwise

Inherited from
_methods
Source
Ordered.scala
@scala.annotation.targetName("greaterOrEqual")
inline def >=(inline v: A): Boolean

Greater or equal

Greater or equal

Returns true if current value is greater or equal to given, false - otherwise

Inherited from
_methods
Source
Ordered.scala
inline def atLeast(v: Year

Max

Max

Returns maximum of current or given value

Inherited from
zMethodsBase
Source
Ordered.scala
inline def atMost(v: Year

Min

Min

Returns minimun of current or given value

Inherited from
zMethodsBase
Source
Ordered.scala

| of days.

| of days.

! of all Days for the year.

Size is 366 for leap and 365 for regular years.

  2018.Year.days.~.range.tp
  // Output
   2018-01-01 <> 2018-12-31
Source
Year.scala
def isCurrent: Boolean
inline def isLeap: Boolean

Leap year indicator.

Leap year indicator.

Leap years have an extra day - Feb 29th.

Leap years usually happen every 4 years. But, let's check:

   // Find every 4th year, which is not leap
   (0 <> 2050).~.map(_.Year).take(_.number % 4 == 0).remove(_.isLeap).tp
   // Output
   ~(100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, 1500, 1700, 1800, 1900)
Source
Year.scala

| of months.

| of months.

! of all Months for the year.

Size is always 12.

   2018.Year.months.~.tp
   // Output
   ~(2018-01, 2018-02, 2018-03, 2018-04, 2018-05, 2018-06, 2018-07, 2018-08, 2018-09, 2018-10, 2018-11, 2018-12)
Source
Year.scala
inline def next: Year

Next in sequance

Next in sequance

Returns next value in sequance

Inherited from
_methods
Source
Sequential.scala
inline def number: Int

Year number.

Year number.

  2018.Year.number.tp // Prints: 2018
Source
Year.scala
inline def period: Period

Year period

Year period

Returns Period from the first moment of the year and the first moment of the next year exclusive.

  2018.Year.period.tp // prints: 2018-01-01 0:00:00 to 2019-01-01 0:00:00
Source
Year.scala
inline def prior: Year

Prior in sequance

Prior in sequance

Returns prior value in sequance

Inherited from
_methods
Source
Sequential.scala
inline def real: Int

Real value

Real value

Returns real value standing behind the opaque type

Inherited from
_methods
Source
__.scala
def start: Time

Year start time

Year start time

Returns Time for the first moment of the year

   2018.Year.start.tp // prints: Time{day=2018-01-01,time=0:00}
Source
Year.scala

Implicit

implicit inline def implicitRequest(inline v: \/): Year
implicit inline def implicitRequest(inline v: CURRENT): Year