-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
49 lines (38 loc) · 1.28 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"fmt"
"time"
"github.com/CapregSoft/go-prayer-time/constants"
"github.com/CapregSoft/go-prayer-time/prayers"
)
func main() {
myDate := time.Now()
//year, month, day := myDate.Date()
latitude := 33.57368163412395
longitude := 73.17308661244054
timezone := 5.0
// Test Prayer times here
//PrayTime prayers = new PrayTime();
//p := prayers.New()
fmt.Println(constants.KARACHI == 1)
pray := &prayers.Prayer{}
pray.Init()
pray.TimeFormat = constants.TIME_12_NS
pray.CalcMethod = constants.KARACHI
pray.AsrJuristic = constants.HANAFI
pray.AdjustHighLats = constants.ANGLE_BASED
for i := 0; i < 1; i++ {
myDate = myDate.Add(time.Hour * 24)
//offsets = []int{0, 0, 0, 0, 0, 0, 0} // {Fajr,Sunrise,Dhuhr,Asr,Sunset,Maghrib,Isha}
//prayers.tune(offsets)
//2021-05-24
prayerTimes := pray.GetPrayerTimes(2021, 5, 6, latitude, longitude, timezone)
//prayerTimesAsStruct := pray.GetPrayerTimesAsStruct(2021, 5, 6, latitude, longitude, timezone)
//prayerTimes := pray.GetPrayerTimes(year, int(month), (day), latitude, longitude, timezone)
prayerNames := pray.TimeName
for i := 0; i < len(prayerTimes); i++ {
fmt.Println(prayerNames[i], " - ", prayerTimes[i])
}
}
//prayerTimes := pray.GetPrayerTimes(2021, 4, 29, latitude, longitude, timezone)
}