ai ile yapılan büyük güncelleme

This commit is contained in:
2026-07-28 10:21:14 +03:00
parent 371eecde2f
commit e71b6d4a91
9 changed files with 781 additions and 314 deletions
+26
View File
@@ -0,0 +1,26 @@
export async function fetchPrayerTimes(cityName = "Istanbul") {
try {
const url =
"https://api.aladhan.com/v1/timingsByCity?city=" +
encodeURIComponent(cityName) +
"&country=Turkey&method=2";
const res = await fetch(url);
if (!res.ok) {
throw new Error("Namaz vakitleri alınamadı");
}
const data = await res.json();
const t = data.data.timings;
return {
fajr: t.Fajr,
sunrise: t.Sunrise,
dhuhr: t.Dhuhr,
asr: t.Asr,
maghrib: t.Maghrib,
isha: t.Isha,
imsak: t.Imsak,
};
} catch (err) {
console.error("Namaz vakti hatası:", err);
return null;
}
}