getSofZmanShma method
A generic method for calculating the latest zman krias shema (time to recite shema in the morning)
that is 3 * shaos zmaniyos (temporal hours) after the start of the day, calculated using the start and
end of the day passed to this method.
The time from the start of day to the end of day are divided into 12 shaos zmaniyos (temporal hours),
and the latest zman krias shema is calculated as 3 of those shaos zmaniyos after the beginning of
the day. As an example, passing getSunrise and getSunset or getSeaLevelSunrise
sea level sunrise and getSeaLevelSunset sea level sunset (depending on the isUseElevation
elevation setting) to this method will return sof zman krias shema according to the opinion of the
GRA.
startOfDay the start of day for calculating zman krias shema. This can be sunrise or any alos passed to this method.
endOfDay the end of day for calculating zman krias shema. This can be sunset or any tzais passed to this method.
return the Date of the latest zman shema based on the start and end of day times passed to this
method. If the calculation can't be computed such as in the Arctic Circle where there is at least one day
a year where the sun does not rise, and one where it does not set, a null will be returned. See detailed
explanation on top of the AstronomicalCalendar documentation.
Implementation
DateTime? getSofZmanShma(DateTime? startOfDay, DateTime? endOfDay) {
if (startOfDay != null && endOfDay != null) {
return getShaahZmanisBasedZman(startOfDay, endOfDay, 3);
}
return getSofZmanShma(
getElevationAdjustedSunrise(), getElevationAdjustedSunset());
}