setJewishDate

Sets the Jewish Date and updates the Gregorian date accordingly.

Parameters

year

the Jewish year. The year can't be negative

month

the Jewish month starting with Nisan. A value of 1 is expected for Nissan ... 12 for Adar and 13 for Adar II. Use the constants NISSAN ... ADAR (or ADAR_II for a leap year Adar II) to avoid any confusion.

dayOfMonth

the Jewish day of month. valid values are 1-30. If the day of month is set to 30 for a month that only has 29 days, the day will be set as 29.

Throws

IllegalArgumentException

if a A Jewish date earlier than 18 Teves, 3761 (1/1/1 Gregorian), a month < 1 or 12 (or 13 on a leap year) or the day of month is < 1 or 30 is passed in


fun setJewishDate(year: Long, month: HebrewMonth, dayOfMonth: Int): JewishDate


fun setJewishDate(year: Long, month: HebrewMonth, dayOfMonth: Int, hours: Int, minutes: Int, chalakim: Int): JewishDate

Sets the Jewish Date and updates the Gregorian date accordingly.

Parameters

year

the Jewish year. The year can't be negative

month

the Jewish month starting with Nisan. A value of 1 is expected for Nissan ... 12 for Adar and 13 for Adar II. Use the constants NISSAN ... ADAR (or ADAR_II for a leap year Adar II) to avoid any confusion.

dayOfMonth

the Jewish day of month. valid values are 1-30. If the day of month is set to 30 for a month that only has 29 days, the day will be set as 29.

hours

the hour of the day. Used for Molad calculations

minutes

the minutes. Used for Molad calculations

chalakim

the chalakim/parts. Used for Molad calculations. The chalakim should not exceed 17. Minutes should be used for larger numbers.

Throws

IllegalArgumentException

if a A Jewish date earlier than 18 Teves, 3761 (1/1/1 Gregorian), a month < 1 or 12 (or 13 on a leap year), the day of month is < 1 or 30, an hour < 0 or 23, a minute < 0 59 or chalakim < 0 >

  1. For larger a larger number of chalakim such as 793 (TaShTzaG) break the chalakim into minutes (18 chalakim per minutes, so it would be 44 minutes and 1 chelek in the case of 793 (TaShTzaG).