feat: Return location info and Hijri date from the prayer times endpoint
This commit is contained in:
+16
-9
@@ -2,6 +2,7 @@ package prayer
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
var ErrInvalidLocation = errors.New("invalid location")
|
||||
@@ -19,16 +20,22 @@ type Location struct {
|
||||
CountryCode string `json:"country_code"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Timezone string `json:"timezone,omitempty"`
|
||||
}
|
||||
|
||||
type Times struct {
|
||||
Date string `json:"date"`
|
||||
DateIslamic string `json:"date_islamic,omitempty"`
|
||||
Fajr string `json:"fajr"`
|
||||
Sunrise string `json:"sunrise"`
|
||||
Dhuhr string `json:"dhuhr"`
|
||||
Asr string `json:"asr"`
|
||||
Sunset string `json:"sunset,omitempty"`
|
||||
Maghrib string `json:"maghrib"`
|
||||
Isha string `json:"isha"`
|
||||
Date time.Time `json:"date"`
|
||||
DateHijri string `json:"date_hijri"`
|
||||
Fajr time.Time `json:"fajr"`
|
||||
Sunrise time.Time `json:"sunrise"`
|
||||
Dhuhr time.Time `json:"dhuhr"`
|
||||
Asr time.Time `json:"asr"`
|
||||
Sunset time.Time `json:"sunset,omitempty"`
|
||||
Maghrib time.Time `json:"maghrib"`
|
||||
Isha time.Time `json:"isha"`
|
||||
}
|
||||
|
||||
type TimesResult struct {
|
||||
Location Location `json:"location"`
|
||||
Times []Times `json:"prayertimes"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user