ZmanCalculationMethod

sealed interface ZmanCalculationMethod

An instance of this class represents a description for how a zman is calculated. The description may rely on other information provided in the ZmanDefinition (e.g. whether the calculation changes depending on the ComplexZmanimCalendar.isUseElevation setting).

Why are there so many ways to calculate a zman? The length of a shaah zmanis (halachic/solar hour) is calculated based on the length of the day. The definition of day has various opinions, and thus the length of a shaah zmanis varies. One such definition is dusk to dawn. Dawn can either be calculated as:

  1. a fixed number of minutes before sunrise,

  2. or as the moment that the sun reaches a number of degrees above the eastern geometric horizon - which happens before sunrise.

Sunrise is an astronomical phenomenon, not subject to varying opinions (save for whether to adjust for elevation). Dusk is often calculated as the inverse of dawn (i.e. after sunrise, and below the western geometric horizon), though some opinions place it orthogonally to their definiition of dawn (e.g. ZmanAuthority.AteretTorah in ComplexZmanimCalendar.shaahZmanisAteretTorah). The number of fixed minutes for sunrise/sunset is determined by the time it takes to walk the distance of a https://en.wikipedia.org/wiki/Biblical_mile. Some interpret those fixed minutes (let M = minutes) as measured by the position of the sun in degrees relative to the eastern geometric horizon M minutes before sunrise in Jerusalem around the equinox / equilux.

This is the distinction between the two aforementioned ways of calculating dawn. Some measure by the length of time it takes to walk 4 mil, while others measure using 5 mil. This is but one divergence of opinion in the calculation of shaah zmanis. Here are all of them:

  1. Fixed minutes or degrees?

    • Measure in fixed minutes or zmaniyos minutes?

  2. How many minutes does it take to walk a mil?

  3. Should a full mil be used to measure, or 3/4 of a mil?

  4. Multiply by 4 or 5 mil?

  5. Account for elevation or not?

  6. When does day start/end?

    • Dawn/dusk

    • sunrise/sunset (which are astronomical phenomena)

    • etc. see DayDefinition

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class DayDefinition(val dayStart: ZmanDefinition, val dayEnd: ZmanDefinition, val dayStartRelationship: ZmanRelationship? = null, val dayEndRelationship: ZmanRelationship? = null) : ZmanCalculationMethod
Link copied to clipboard
data class Degrees(val degrees: Float) : ZmanCalculationMethod

Dawn is when the sun is x degrees below the eastern geometric horizon before sunrise. Dusk is when the sun is x degrees below the western geometric horizon after sunset.

Link copied to clipboard
data class FixedDuration(val duration: Duration) : ZmanCalculationMethod

Dawn for this calculation is 60 minutes before sunrise. Dusk is 60 minutes after sunset.

Link copied to clipboard
Link copied to clipboard
data class LaterOf(val zman1: ZmanDefinition, val zman2: ZmanDefinition) : ZmanCalculationMethod

A method of calculation in which the later of two zmanim is used. Meaning that if zman1 occurs at 6:00 AM and zman2 occurs at 6:05 AM, this zman takes on the value of 6:00 AM.

Link copied to clipboard
data class Relationship(val relationship: ZmanRelationship) : ZmanCalculationMethod

A method of calculation in which the zman is calculated relative to another zman (e.g. X occurs 10 minutes before Y). If a com.kosherjava.zmanim.Zman uses this ZmanCalculationMethod, the information on how it is calculated will be in the relationship

Link copied to clipboard

A form of empty set/placeholder indicating that the calculation method was not specified/is irrelevant. Almost exclusively used when defining a ZmanDefinition that is reused across zmanim.

Link copied to clipboard
data class ZmaniyosDuration(val duration: Duration) : ZmanCalculationMethod

Dawn for this calculation is X zmaniyos minutes before sunrise. Dusk is X zmaniyos minutes after sunset.

Functions

Link copied to clipboard
open fun Duration.durationValueToString(halachic: Boolean = false): String
Link copied to clipboard
open fun format(): String
open fun format(inEnglish: Boolean): String
open fun format(subjectZman: String, zmanRelativeTo: String): String
Link copied to clipboard
open fun shortDescription(): String
Link copied to clipboard
abstract fun valueToString(): String