feat: Return location info and Hijri date from the prayer times endpoint

This commit is contained in:
2026-02-21 02:07:22 +03:00
parent 07a9703a89
commit c106d57fe6
9 changed files with 358 additions and 87 deletions
+16 -9
View File
@@ -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"`
}