HebrewLocalDate

data class HebrewLocalDate(val year: Long, val month: HebrewMonth, val dayOfMonth: Int) : Comparable<HebrewLocalDate>

A class representing a Hebrew local date. Hebrew analog to kotlinx.datetime.LocalDate Although the Hebrew year actually starts in HebrewMonth.TISHREI, the choice was made to assign HebrewMonth.NISSAN with a value of 1. This may be because the year is colloquially said to start in Nissan (in accordance with the opinion Maseches Rosh Hashana (TODO include source) that the world was created in Nissan). Note: this class considers the Gregorian calendar to start at year 0, in accordance with ISO-8601.

Parameters

year

the Hebrew year Ano Mundi, e.g. 5783 (2023 Gregorian)

dayOfMonth

the day of the month. This is a value between 1 and 30. Leap years can change the upper-bound of this number.

month

the Hebrew month. This is a value between 1 and 13. The value of 13 represents Adar II on a leap year.

Constructors

Link copied to clipboard
constructor(year: Int, month: HebrewMonth, dayOfMonth: Int)
constructor(year: Long, month: HebrewMonth, dayOfMonth: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val dayOfMonth: Int
Link copied to clipboard
val isJewishLeapYear: Boolean
Link copied to clipboard
Link copied to clipboard
val year: Long

Functions

Link copied to clipboard
open operator override fun compareTo(other: HebrewLocalDate): Int

Compares this date to another date.

Link copied to clipboard
fun plusDays(days: Long): HebrewLocalDate

Returns a copy of this HebrewLocalDate with the specified number of days added.

Link copied to clipboard
fun toJewishEpochDays(): Long
Link copied to clipboard
fun toLocalDateGregorian(): LocalDate

Computes the Gregorian LocalDate of a given HebrewLocalDate. Note: this class considers the Gregorian calendar to start at year 0, in accordance with ISO-8601.

Link copied to clipboard
fun withDayOfMonth(newDayOfMonth: Int): HebrewLocalDate

Returns this object with the dayOfMonth set to the given newDayOfMonth.

Link copied to clipboard

Returns this object with the month set to the given newMonth.

Link copied to clipboard
fun withYear(newYear: Int): HebrewLocalDate

fun withYear(newYear: Long): HebrewLocalDate

Returns this object with the year set to the given newYear.