Documentation
¶
Index ¶
- Variables
- func DaysSinceSolstice(dayOfYear int, year int, latitude float64) int
- func SeasonAdjustedEveningTwilight(latitude float64, day int, year int, sunset time.Time) time.Time
- func SeasonAdjustedMorningTwilight(latitude float64, day int, year int, sunrise time.Time) time.Time
- type AsrJuristicMethod
- type CalculationMethod
- type CalculationParameters
- type CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) Build() *CalculationParameters
- func (cpb *CalculationParametersBuilder) SetAdjustments(adjustments PrayerAdjustments) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetFajrAngle(fajrAngle float64) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetHighLatitudeRule(highLatitudeRule HighLatitudeRule) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetIshaAngle(ishaAngle float64) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetIshaInterval(ishaInterval int) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetMadhab(madhab AsrJuristicMethod) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetMethod(m CalculationMethod) *CalculationParametersBuilder
- func (cpb *CalculationParametersBuilder) SetMethodAdjustments(methodAdjustments PrayerAdjustments) *CalculationParametersBuilder
- type HighLatitudeRule
- type NightPortions
- type Prayer
- type PrayerAdjustments
- type PrayerTimes
- func (p *PrayerTimes) CurrentPrayer(t time.Time) Prayer
- func (p *PrayerTimes) CurrentPrayerNow() Prayer
- func (p *PrayerTimes) NextPrayer(t time.Time) Prayer
- func (p *PrayerTimes) NextPrayerNow() Prayer
- func (p *PrayerTimes) SetTimeZone(tzone string) error
- func (p *PrayerTimes) TimeForPrayer(prayer Prayer) time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var MadhabToShadowLengthMap = map[AsrJuristicMethod]util.ShadowLength{ SHAFI_HANBALI_MALIKI: util.SINGLE, HANAFI: util.DOUBLE, }
Functions ¶
Types ¶
type AsrJuristicMethod ¶
type AsrJuristicMethod int64
const ( SHAFI_HANBALI_MALIKI AsrJuristicMethod = iota HANAFI )
type CalculationMethod ¶
type CalculationMethod int64
const ( OTHER CalculationMethod = iota // Muslim World League // Uses Fajr angle of 18 and an Isha angle of 17 MUSLIM_WORLD_LEAGUE // Egyptian General Authority of Survey // Uses Fajr angle of 19.5 and an Isha angle of 17.5 EGYPTIAN // University of Islamic Sciences, Karachi // Uses Fajr angle of 18 and an Isha angle of 18 KARACHI // Umm al-Qura University, Makkah // Uses a Fajr angle of 18.5 and an Isha angle of 90. Note: You should add a +30 minute custom // adjustment of Isha during Ramadan. UMM_AL_QURA // The Gulf Region // Uses Fajr and Isha angles of 18.2 degrees. DUBAI // Moonsighting Committee // Uses a Fajr angle of 18 and an Isha angle of 18. Also uses seasonal adjustment values. MOON_SIGHTING_COMMITTEE // Referred to as the ISNA method // This method is included for completeness, but is not recommended. // Uses a Fajr angle of 15 and an Isha angle of 15. NORTH_AMERICA // Kuwait // Uses a Fajr angle of 18 and an Isha angle of 17.5 KUWAIT // Qatar // Modified version of Umm al-Qura that uses a Fajr angle of 18. QATAR // Singapore // Uses a Fajr angle of 20 and an Isha angle of 18 SINGAPORE // UOIF // Uses a Fajr angle of 12 and an Isha angle of 12 UOIF )
type CalculationParameters ¶
type CalculationParameters struct { // The method used to do the calculation Method CalculationMethod // The angle of the sun used to calculate fajr FajrAngle float64 // The angle of the sun used to calculate isha IshaAngle float64 // Minutes after Maghrib (if set, the time for Isha will be Maghrib plus IshaInterval) IshaInterval int // The juristic method used to calculate Asr Madhab AsrJuristicMethod // Rules for placing bounds on Fajr and Isha for high latitude areas HighLatitudeRule HighLatitudeRule // Used to optionally add or subtract a set amount of time from each prayer time Adjustments PrayerAdjustments // Used for method adjustments MethodAdjustments PrayerAdjustments }
func GetMethodParameters ¶
func GetMethodParameters(method CalculationMethod) *CalculationParameters
func (*CalculationParameters) NightPortions ¶
func (c *CalculationParameters) NightPortions() (*NightPortions, error)
type CalculationParametersBuilder ¶
type CalculationParametersBuilder struct { // The method used to do the calculation Method CalculationMethod // The angle of the sun used to calculate fajr FajrAngle float64 // The angle of the sun used to calculate isha IshaAngle float64 // Minutes after Maghrib (if set, the time for Isha will be Maghrib plus IshaInterval) IshaInterval int // The juristic method used to calculate Asr Madhab AsrJuristicMethod // Rules for placing bounds on Fajr and Isha for high latitude areas HighLatitudeRule HighLatitudeRule // Used to optionally add or subtract a set amount of time from each prayer time Adjustments PrayerAdjustments // Used for method adjustments MethodAdjustments PrayerAdjustments }
func NewCalculationParametersBuilder ¶
func NewCalculationParametersBuilder() *CalculationParametersBuilder
func (*CalculationParametersBuilder) Build ¶
func (cpb *CalculationParametersBuilder) Build() *CalculationParameters
func (*CalculationParametersBuilder) SetAdjustments ¶
func (cpb *CalculationParametersBuilder) SetAdjustments(adjustments PrayerAdjustments) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetFajrAngle ¶
func (cpb *CalculationParametersBuilder) SetFajrAngle(fajrAngle float64) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetHighLatitudeRule ¶
func (cpb *CalculationParametersBuilder) SetHighLatitudeRule(highLatitudeRule HighLatitudeRule) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetIshaAngle ¶
func (cpb *CalculationParametersBuilder) SetIshaAngle(ishaAngle float64) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetIshaInterval ¶
func (cpb *CalculationParametersBuilder) SetIshaInterval(ishaInterval int) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetMadhab ¶
func (cpb *CalculationParametersBuilder) SetMadhab(madhab AsrJuristicMethod) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetMethod ¶
func (cpb *CalculationParametersBuilder) SetMethod(m CalculationMethod) *CalculationParametersBuilder
func (*CalculationParametersBuilder) SetMethodAdjustments ¶
func (cpb *CalculationParametersBuilder) SetMethodAdjustments(methodAdjustments PrayerAdjustments) *CalculationParametersBuilder
type HighLatitudeRule ¶
type HighLatitudeRule int64
const ( NO_HIGH_LATITUDE_RULE HighLatitudeRule = iota // Fajr will never be earlier than the middle of the night, and Isha will never be later than // the middle of the night. MIDDLE_OF_THE_NIGHT // Fajr will never be earlier than the beginning of the last seventh of the night, and Isha will // never be later than the end of the first seventh of the night. SEVENTH_OF_THE_NIGHT // Similar to SEVENTH_OF_THE_NIGHT, but instead of 1/7th, the fraction of the night used // is fajrAngle / 60 and ishaAngle/60. TWILIGHT_ANGLE )
type NightPortions ¶
func NewNightPortions ¶
func NewNightPortions(fajr float64, isha float64) (*NightPortions, error)
type PrayerAdjustments ¶
type PrayerTimes ¶
type PrayerTimes struct { Fajr time.Time Sunrise time.Time Dhuhr time.Time Asr time.Time Maghrib time.Time Isha time.Time Coords *util.Coordinates DateComponent *data.DateComponents CalculationParams *CalculationParameters }
func NewPrayerTimes ¶
func NewPrayerTimes(coords *util.Coordinates, date *data.DateComponents, params *CalculationParameters) (*PrayerTimes, error)
func (*PrayerTimes) CurrentPrayer ¶
func (p *PrayerTimes) CurrentPrayer(t time.Time) Prayer
func (*PrayerTimes) CurrentPrayerNow ¶
func (p *PrayerTimes) CurrentPrayerNow() Prayer
func (*PrayerTimes) NextPrayer ¶
func (p *PrayerTimes) NextPrayer(t time.Time) Prayer
func (*PrayerTimes) NextPrayerNow ¶
func (p *PrayerTimes) NextPrayerNow() Prayer
func (*PrayerTimes) SetTimeZone ¶
func (p *PrayerTimes) SetTimeZone(tzone string) error
func (*PrayerTimes) TimeForPrayer ¶
func (p *PrayerTimes) TimeForPrayer(prayer Prayer) time.Time
Click to show internal directories.
Click to hide internal directories.