Documentation
¶
Index ¶
- type AsrConvention
- type Config
- type HighLatitudeAdapter
- func AlwaysMecca() HighLatitudeAdapter
- func AngleBased() HighLatitudeAdapter
- func LocalRelativeEstimation() HighLatitudeAdapter
- func Mecca() HighLatitudeAdapter
- func MiddleNight() HighLatitudeAdapter
- func NearestDay() HighLatitudeAdapter
- func NearestLatitude() HighLatitudeAdapter
- func NearestLatitudeAsIs() HighLatitudeAdapter
- func OneSeventhNight() HighLatitudeAdapter
- func ShariNormalDay() HighLatitudeAdapter
- type Schedule
- type ScheduleCorrections
- type TwilightConvention
- func Algerian() *TwilightConvention
- func AstronomicalTwilight() *TwilightConvention
- func Diyanet() *TwilightConvention
- func Egypt() *TwilightConvention
- func EgyptBis() *TwilightConvention
- func France15() *TwilightConvention
- func France18() *TwilightConvention
- func Gulf() *TwilightConvention
- func ISNA() *TwilightConvention
- func JAKIM() *TwilightConvention
- func Jafari() *TwilightConvention
- func Karachi() *TwilightConvention
- func Kemenag() *TwilightConvention
- func MUIS() *TwilightConvention
- func MWL() *TwilightConvention
- func Tehran() *TwilightConvention
- func Tunisia() *TwilightConvention
- func UOIF() *TwilightConvention
- func UmmAlQura() *TwilightConvention
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsrConvention ¶
type AsrConvention int
AsrConvention is the convention for calculating Asr time.
const ( // Shafii is the school which said that the Asr time is when the shadow of an // object is equals the length of the object plus the length of its shadow when // the Sun is at its zenith. Shafii AsrConvention = iota // Hanafi is the school which said that the Asr time is when the shadow of an // object is twice the length of the object plus the length of its shadow when // the Sun is at its zenith. Hanafi )
type Config ¶
type Config struct {
// Latitude is the latitude of the location. Positive for north area and negative
// for south area.
Latitude float64
// Longitude is the longitude of the location. Positive for east area and negative
// for west area.
Longitude float64
// Elevation is the elevation of the location above sea level. It's used to
// improve calculation for sunrise and sunset by factoring the value of
// atmospheric refraction. However, apparently most of the prayer time
// calculator doesn't use it so it's fine to omit it.
Elevation float64
// Timezone is the time zone of the location specified above. If not specified,
// it will use UTC.
Timezone *time.Location
// TwilightConvention is the convention that used to specify time for Fajr and
// Isha. By default it will use `AstronomicalTwilight`.
TwilightConvention *TwilightConvention
// AsrConvention is the convention that used for calculating Asr time. There are
// two conventions, Shafii and Hanafi. By default it will use Shafii.
AsrConvention AsrConvention
// HighLatitudeAdapter is the function for adjusting prayer times in area with
// high latitude (>=45 degrees). If not specified, it will not calculate the
// adjustment for higher latitude and instead will return the schedule as it is.
// For area in high or extreme latitude, it might return zero for Fajr, Sunrise,
// Maghrib and Isha.
HighLatitudeAdapter HighLatitudeAdapter
// Corrections is used to corrects calculated time for each specified prayer.
Corrections ScheduleCorrections
// PreciseToSeconds specify whether output time will omit the seconds or not.
PreciseToSeconds bool
}
Config is configuration that used to calculate the prayer times.
type HighLatitudeAdapter ¶ added in v1.1.0
HighLatitudeAdapter is function for calculating prayer times in area with latitude >45 degrees. Check out https://www.prayertimes.dk/story.html for why this is needed.
func AlwaysMecca ¶ added in v1.1.0
func AlwaysMecca() HighLatitudeAdapter
AlwaysMecca is similar with `Mecca`, except it will be applied every day and not only on the "abnormal" days.
This adapter doesn't require the sunrise and sunset to be exist in a day, so it's usable for area in extreme latitudes (>=65 degrees).
func AngleBased ¶
func AngleBased() HighLatitudeAdapter
AngleBased is adapter where the night period is divided into several parts, depending on the value of twilight angle for Fajr and Isha.
For example, let a be the twilight angle for Isha, and let t = a/60. The period between sunset and sunrise is divided into t parts. Isha begins after the first part. So, if the twilight angle for Isha is 15, then Isha begins at the end of the first quarter (15/60) of the night. Time for Fajr is calculated similarly.
This adapter depends on sunrise and sunset time, so it might not be suitable for area in extreme latitudes (>=65 degrees).
Reference: http://praytimes.org/calculation
func LocalRelativeEstimation ¶ added in v1.1.0
func LocalRelativeEstimation() HighLatitudeAdapter
LocalRelativeEstimation is adapter using method that created by cooperation between Fiqh Council of Muslim World League and Islamic Crescents' Observation Project (ICOP). In short, this method uses average percentage to calculate Fajr and Isha time for abnormal times.
This adapter only estimates time for Isha and Fajr and require sunrise and sunset time. Therefore it's not suitable for area in extreme latitude (>=65 degrees).
Reference: https://www.astronomycenter.net/latitude.html?l=en
func Mecca ¶ added in v1.1.0
func Mecca() HighLatitudeAdapter
Mecca is adapter based on Fatwa from Dar Al Iftah Al Misrriyah number 2806 dated at 2010-08-08. They propose that area with higher latitude to follows the schedule in Mecca when abnormal days occured, using transit time as the common point. Here the day is considered "abnormal" when there are no true night, or the day length is less than 4 hours.
To prevent sudden schedule changes, this method uses transition period for maximum one month before and after the abnormal periods.
This adapter doesn't require the sunrise and sunset to be exist in a day, so it's usable for area in extreme latitudes (>=65 degrees).
Reference: https://www.prayertimes.dk/fatawa.html
func MiddleNight ¶
func MiddleNight() HighLatitudeAdapter
MiddleNight is adapter where the night period is divided into two halves. The first half is considered to be the "night" and the other half as "day break". Fajr and Isha in this method are assumed to be at mid-night during the abnormal periods.
This adapter depends on sunrise and sunset time, so it might not be suitable for area in extreme latitudes (>=65 degrees).
Reference: http://praytimes.org/calculation
func NearestDay ¶ added in v1.1.0
func NearestDay() HighLatitudeAdapter
NearestDay is adapter where the schedule for "abnormal" days will be taken from the schedule of the last "normal" day.
This adapter doesn't require the sunrise and sunset to be exist in a day, so it's usable for area in extreme latitudes (>=65 degrees).
func NearestLatitude ¶ added in v1.1.0
func NearestLatitude() HighLatitudeAdapter
NearestLatitude is adapter where the schedules will be estimated using percentage of schedule in location at 45 degrees latitude. This method will change the schedule for entire year to prevent sudden changes in fasting time.
This adapter only estimates time for Isha and Fajr and require sunrise and sunset time. Therefore it's not suitable for area in extreme latitude (>=65 degrees).
Reference: https://fiqh.islamonline.net/en/praying-and-fasting-at-high-latitudes/
func NearestLatitudeAsIs ¶ added in v1.1.0
func NearestLatitudeAsIs() HighLatitudeAdapter
NearestLatitudeAsIs is similar with `NearestLatitude` except it will use the schedule from 45 degrees latitude as it is without any change. Like `NearestLatitude`, this method will change the schedule for entire year to prevent sudden changes in fasting time.
This adapter doesn't require the sunrise and sunset to be exist in a day, so it's usable for area in extreme latitudes (>=65 degrees).
Reference: https://fiqh.islamonline.net/en/praying-and-fasting-at-high-latitudes/
func OneSeventhNight ¶
func OneSeventhNight() HighLatitudeAdapter
OneSeventhNight is adapter where the night period is divided into seven parts. Isha starts when the first seventh part ends, and Fajr starts when the last seventh part starts.
This adapter depends on sunrise and sunset time, so it might not be suitable for area in extreme latitudes (>=65 degrees).
Reference: http://praytimes.org/calculation
func ShariNormalDay ¶ added in v1.1.0
func ShariNormalDay() HighLatitudeAdapter
ShariNormalDay is adapter following method that proposed by Mohamed Nabeel Tarabishy, Ph.D.
He proposes that a normal day is defined as day when the fasting period is between 10h17m and 17h36m. If the day is "abnormal" then the fasting times is calculated using the schedule for area with 45 degrees latitude.
This adapter doesn't require the sunrise and sunset to be exist in a day, so it's usable for area in extreme latitudes (>=65 degrees).
Do note in this method there will be sudden changes in the length of the day of fasting. To avoid this issue, the author has given suggestion to just use the schedule from 45° on permanent basis. So, following that suggestion, you might be better using other adapter like `NearestLatitude` or `NearestLatitudeAsIs`.
Reference: https://www.astronomycenter.net/pdf/tarabishyshigh_2014.pdf
type Schedule ¶ added in v1.1.0
type Schedule struct {
// Date is the ISO date, useful for logging.
Date string
// Fajr is the time when the sky begins to lighten (dawn) after previously
// completely dark.
Fajr time.Time
// Sunrise is the moment when the upper limb of the Sun appears on the horizon
// in the morning.
Sunrise time.Time
// Zuhr is the time when the Sun begins to decline after reaching the highest
// point in the sky, so a bit after solar noon.
Zuhr time.Time
// Asr is the time when the length of any object's shadow reaches a factor of
// the length of the object itself plus the length of that object's shadow at
// noon.
Asr time.Time
// Maghrib is sunset, i.e. the time when the upper limb of the Sun disappears
// below the horizon.
Maghrib time.Time
// Isha is the time when darkness falls and after this point the sky is no longer
// illuminated (dusk).
Isha time.Time
// IsNormal specify whether the day have a normal day night period or not. It
// will be false in area with higher latitude, when Sun never rise or set in
// extreme periods.
IsNormal bool
}
Schedule is the time of each prayer (and related events) on a day.
type ScheduleCorrections ¶ added in v1.1.0
type ScheduleCorrections struct {
Fajr time.Duration
Sunrise time.Duration
Zuhr time.Duration
Asr time.Duration
Maghrib time.Duration
Isha time.Duration
}
ScheduleCorrections is correction for each prayer time.
type TwilightConvention ¶ added in v1.1.0
type TwilightConvention struct {
FajrAngle float64
IshaAngle float64
MaghribDuration time.Duration
}
TwilightConvention is the convention that specifies time for Fajr (dawn) and Isha (dusk). Most of the conventions use Solar angle elevation for both dawn and dusk time, however there are several convention where dusk times depends on sunset (Maghrib) times.
func Algerian ¶
func Algerian() *TwilightConvention
Algerian is calculation method from Algerian Ministry of Religious Affairs and Wakfs. Fajr at 18° and Isha at 17°.
func AstronomicalTwilight ¶ added in v1.1.0
func AstronomicalTwilight() *TwilightConvention
AstronomicalTwilight is moment when Sun is 18 degrees below horizon. At this point most stars and other celestial objects still can be seen, however astronomers may be unable to observe some of the fainter stars and galaxies, hence the name of this twilight phase. This is the default twilight convention for this package.
func Diyanet ¶
func Diyanet() *TwilightConvention
Diyanet is calculation method from Turkey's Diyanet İşleri Başkanlığı. It has the same value as MWL with Fajr at 18° and Isha at 17°.
func Egypt ¶
func Egypt() *TwilightConvention
Egypt is calculation method from Egyptian General Authority of Survey with Fajr at 19.5° and Isha at 17.5°. Used in Africa, Syria and Lebanon.
func EgyptBis ¶
func EgyptBis() *TwilightConvention
EgyptBis is another version of calculation method from Egyptian General Authority of Survey. Fajr at 20° and Isha at 18°.
func France15 ¶
func France15() *TwilightConvention
France15 is calculation method for France region with Fajr and Isha both at 15°.
func France18 ¶
func France18() *TwilightConvention
France18 is calculation method for France region with Fajr and Isha both at 18°.
func Gulf ¶
func Gulf() *TwilightConvention
Gulf is calculation method that often used by countries in Gulf region like UAE and Kuwait. Fajr at 19.5° and Isha fixed at 90 minutes after Maghrib.
func ISNA ¶
func ISNA() *TwilightConvention
ISNA is calculation method from Islamic Society of North America with both Fajr and Isha at 15°. Used in North America i.e US and Canada.
func JAKIM ¶
func JAKIM() *TwilightConvention
JAKIM is calculation method from Jabatan Kemajuan Islam Malaysia. Fajr at 20° and Isha at 18°.
func Jafari ¶
func Jafari() *TwilightConvention
Jafari is calculation method from Shia Ithna Ashari that used in some Shia communities worldwide. Fajr at 16° and Isha at 14°.
func Karachi ¶
func Karachi() *TwilightConvention
Karachi is calculation method from University of Islamic Sciences, Karachi, with both Fajr and Isha at 18°. Used in Pakistan, Afganistan, Bangladesh and India.
func Kemenag ¶
func Kemenag() *TwilightConvention
Kemenag is calculation method from Kementerian Agama Republik Indonesia. Fajr at 20° and Isha at 18°.
func MUIS ¶
func MUIS() *TwilightConvention
MUIS is calculation method from Majlis Ugama Islam Singapura. Fajr at 20° and Isha at 18°.
func MWL ¶
func MWL() *TwilightConvention
MWL is calculation method from Muslim World League with Fajr at 18° and Isha at 17°. Usually used in Europe, Far East and parts of America.
func Tehran ¶
func Tehran() *TwilightConvention
Tehran is calculation method from Institute of Geophysics at University of Tehran. Fajr at 17.7° and Isha at 14°.
func Tunisia ¶
func Tunisia() *TwilightConvention
Tunisia is calculation method from Tunisian Ministry of Religious Affairs. Fajr and Isha both at 18°.
func UOIF ¶
func UOIF() *TwilightConvention
UOIF is calculation method from Union Des Organisations Islamiques De France. Fajr and Isha both at 12°.
func UmmAlQura ¶
func UmmAlQura() *TwilightConvention
UmmAlQura is calculation method from Umm al-Qura University in Makkah which used in Saudi Arabia. Fajr at 18.5° and Isha fixed at 90 minutes after Maghrib.
Source Files
¶
- 0-root.go
- 1-twilight.go
- 2-asr.go
- 4-normal.go
- 5-high-lat-angle-based.go
- 5-high-lat-local-relative.go
- 5-high-lat-mecca-always.go
- 5-high-lat-mecca.go
- 5-high-lat-middle-night.go
- 5-high-lat-nearest-day.go
- 5-high-lat-nearest-latitude-as-is.go
- 5-high-lat-nearest-latitude.go
- 5-high-lat-seventh-night.go
- 5-high-lat-shari-day.go
- 6-abnormal-schedules.go
- 6-utils-slice.go