Year

opaque type Year

Calendar Year

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

Source
Year.scala

Def

@targetName("plus")
inline def +(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
@targetName("minus")
inline def -(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
@targetName("less")
inline def <(v: Year): Boolean

Less

Less

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

Inherited from
_methods
Source
Ordered.scala
@targetName("lessOrEqual")
inline def <=(v: Year): 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
@targetName("range")
inline def <>(to: Int.G.Range[Year]

Range

Range

Returns Range from current to given value

Note. Range uses base primitive natural ordering

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

Range by size

Range by size

Returns Range from current value to current plus given size exclusive

Note. Range uses base primitive natural ordering

Inherited from
z_MethodsBase
Source
Ordered.scala
@targetName("rangeX")
inline def <>>(to: Int.G.Range[Year]

Exclusive end range

Exclusive end range

Returns Range from current to given value exclusive

Note. Range uses base primitive natural ordering

Inherited from
z_MethodsBase
Source
Ordered.scala
@targetName("greater")
inline def >(v: Year): Boolean

Greater

Greater

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

Inherited from
_methods
Source
Ordered.scala
@targetName("greaterOrEqual")
inline def >=(v: Year): 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
@targetName("Opt")
inline def ?: Int.G.Opt[Year]

To option

To option

Returns Int specialized option

Inherited from
_methods
Source
Base.scala

Index of days.

Index of days.

Index of all Days for the year.

Size is 366 for leap and 365 for regular years.

  2018.Year.days.stream.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).stream.map(_.Year).take(_.number % 4 == 0).remove(_.isLeap).tp
   // Output
   Stream(100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, 1500, 1700, 1800, 1900)
Source
Year.scala
inline def max(v:

Max value

Max value

Returns maximum of current or given value

Inherited from
z_MethodsBase
Source
Ordered.scala
inline def min(v:

Min value

Min value

Returns minimun of current or given value

Inherited from
z_MethodsBase
Source
Ordered.scala

Index of months.

Index of months.

Index of all Months for the year.

Size is always 12.

   2018.Year.months.stream.tp
   // Output
   Stream(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 Int value standing behind the opaque type.

This is a zero cost call.

Inherited from
_methods
Source
Base.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