Giter VIP home page Giter VIP logo

aladhan.com's People

Contributors

akhandok avatar dependabot[bot] avatar kh4lidmd avatar meezaan avatar papasmile avatar tarek-adra avatar youssefmoataz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aladhan.com's Issues

Question: How does the GetTimingsByCity API behave?

Hello ๐Ÿ‘‹๐Ÿพ First off I would like thank you all for your efforts in this project. I have a few questions regrading the behavior of the https://aladhan.com/prayer-times-api#GetTimingsByCity API. I'm not sure this is the proper repo to ask tis question so feel free to transfer this issue to the proper location.

  1. What are the supported countries for this API?

  2. For the state field is this analogous to providence for countries like Canada? e.g. If I wanted prayer times for toronto would I provide?city=Toronto&state=Ontario&country= CA ?

  3. If you run a dummy request with invalid country it could guess the closest city with that name? For example using the city Rochester with the country foo returns the following: As you can see below, the data returned is for Rochester, NY, US. Seems like the API uses google geocoding to guess your location? How does it choose Rochester, NY when there are multiple cities named Rochester in the US? Is there a way to disable using geocoding and simply return an error if the city + state + country is invalid?

You can test this by going here: https://api.aladhan.com/v1/timingsByCity?city=Rochester&state=&country=foo

{
  "code":200,
  "status":"OK",
  "data":{
     "timings":{
        "Fajr":"05:43",
        "Sunrise":"07:02",
        "Dhuhr":"12:24",
        "Asr":"15:19",
        "Sunset":"17:47",
        "Maghrib":"17:47",
        "Isha":"19:06",
        "Imsak":"05:33",
        "Midnight":"00:24"
     },
     "date":{
        "readable":"19 Feb 2021",
        "timestamp":"1613790206",
        "hijri":{
           "date":"07-07-1442",
           "format":"DD-MM-YYYY",
           "day":"07",
           "weekday":{
              "en":"Al Juma'a",
              "ar":"\u0627\u0644\u062c\u0645\u0639\u0629"
           },
           "month":{
              "number":7,
              "en":"Rajab",
              "ar":"\u0631\u064e\u062c\u064e\u0628"
           },
           "year":"1442",
           "designation":{
              "abbreviated":"AH",
              "expanded":"Anno Hegirae"
           },
           "holidays":[
              
           ]
        },
        "gregorian":{
           "date":"19-02-2021",
           "format":"DD-MM-YYYY",
           "day":"19",
           "weekday":{
              "en":"Friday"
           },
           "month":{
              "number":2,
              "en":"February"
           },
           "year":"2021",
           "designation":{
              "abbreviated":"AD",
              "expanded":"Anno Domini"
           }
        }
     },
     "meta":{
        "latitude":43.1448135,
        "longitude":-77.5903625,
        "timezone":"America\/New_York",
        "method":{
           "id":2,
           "name":"Islamic Society of North America (ISNA)",
           "params":{
              "Fajr":15,
              "Isha":15
           }
        },
        "latitudeAdjustmentMethod":"ANGLE_BASED",
        "midnightMode":"STANDARD",
        "school":"STANDARD",
        "offset":{
           "Imsak":0,
           "Fajr":0,
           "Sunrise":0,
           "Dhuhr":0,
           "Asr":0,
           "Maghrib":0,
           "Sunset":0,
           "Isha":0,
           "Midnight":0
        }

Prayer times as a calendar-ready CSV

User Story

As an organised person and a praying person, I want my day to be well- planned. I use calendar apps intensively to plan the day, and all my personal and work entries are there. I want to make sure I make enough time for my daily prayers, so Iโ€™d like to have them added to my calendar as standard calendar entries. That would also mark me busy for my family and coworkers who check my availability before scheduleing meetings and calls. So I want to have an option to download prayers timetable as a CSV to import it later to my calendar. CSVs should be available with data for a year (for prayers in permanent stay area), a month, a week, and a single day (for long and short trips).

For example, part of the CSV for 1 September 2021 could look like this:

Subject Start Date Start Time
Fajr 01-09-2021 03:29
Sunrise 01-09-2021 05:34
Dhuhr 01-09-2021 12:30
Asr 01-09-2021 16:14
Maghrib 01-09-2021 19:24
Isha 01-09-2021 21:18

aladhan.com blocked from my country (AU)

Assallam,

It seems a few people have this issue, I figured I would report here too. I cannot access aladhan.com from multiple AU IP's but I can access it from a Ukraine IP range fine. Is there some sort of geo blocking occurring now?

This has also affected a few Home Assistant users for the Islamic Prayer times integration which uses the aladhan.com API.

Remove dependency on API Code

There is currently a dependency on the HijriCalendarService class in the API. Update the API client and use that instead!

Incorrect "tune" documentation?

I believe the documentation for the tune parameter is incorrect.

The documentation mentions that the order is: Imsak,Fajr,Sunrise,Zhuhr,Asr,Sunset,Maghrib,Isha,Midnight

However, I think Sunset,Maghrib are flipped.

The example URL has Sunset = 3 and Maghrib = 4: https://api.aladhan.com/timingsByAddress/09-03-2015?address=Dubai,UAE&method=8&tune=2,3,4,5,2,3,4,5,-3

However, the response clearly uses Sunset = 4 and Maghrib = 3:

"offset":{"Imsak":"2","Fajr":"3","Sunrise":"4","Dhuhr":"5","Asr":"2","Maghrib":"3","Sunset":"4","Isha":"5","Midnight":"-3"}

Should the documentation describing the order be updated?

Change in UI

I am planning to change the following set in the wesite:

  1. Font Weight
  2. Font Color

Introduce better error handling for unknown locations

As /play and /calendar are now rendering on the server side, we're logging some bad location errors for locations we can't geolocate.

We need a pretty and graceful way to handle these 400 errors from the API.

A try and catch will do, but the app routes file needs cleaning up and this is an opportunity to get a handle on some of that code.

Blocked CORS in Chrome Extension

I have a Chrome Extension called Quran In a New Tab and I've been using this API for a while. However, recently all requests are blocked with the following error:

Access to XMLHttpRequest at 'http://api.aladhan.com/v1/hToG?date=27-5-1443' from origin 'chrome-extension://fdhiopcnpihkmbkfagjdibggbaangnjp' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

If it's possible to fix this issue it would be of great help. Thank you.

Stop Endless Retires for Bad Location

Entering a bad location results in endless retires to geocode. It seems that successful geocode calls update timings but error responses do not:

success: function(data) {
// Update timings
gc._timings = data.data.timings;
},
error: function() {
console.log('API threw an error!');
}
});

One solution would be to clear out _location on error and display an error message above location field. Could be annoying for slow typers, though, since we auto-fetch every seven seconds...

Incorrect calculation post daylight savings

Post daylight savings, (using the Umm ul-Qurra method) the Isha calculation after maghrib is off by 30 minutes. it used to correctly show Isha being 90 minutes after maghrib, but now it's 120 minutes after maghrib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.