Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo date calculations with IntlDateTimeFormatter #29

Open
meezaan opened this issue Aug 31, 2019 · 2 comments
Open

Redo date calculations with IntlDateTimeFormatter #29

meezaan opened this issue Aug 31, 2019 · 2 comments

Comments

@meezaan
Copy link
Member

meezaan commented Aug 31, 2019

Like this example:

$DateTime = new DateTime();
$IntlDateFormatter = new IntlDateFormatter(
                    'en_US@calendar=islamic-civil', // or islamic
                    IntlDateFormatter::FULL,
                    IntlDateFormatter::FULL,
                    'Asia/Tehran',
                    IntlDateFormatter::TRADITIONAL);

echo $IntlDateFormatter->format($DateTime);
@papasmile
Copy link

Salam, @meezaan couple questions:

  1. Are you talking about timings/v1/prayerTimes.php, timings/v1/dateAndTime.php, or other routes as well?
  2. Are you thinking to change the * output * of any of those routes, or just internal calculations?

@meezaan
Copy link
Member Author

meezaan commented Apr 5, 2020

No, this refers to https://github.com/islamic-network/api.aladhan.com/blob/master/src/AlAdhanApi/Model/HijriCalendarService.php in general. There are always discrepancies with Hijri dates.

The IntlDateFormatterseemed a better approach but it also has discrepancies, so I'm in 2 minds about whether to do this or not. I've started work on a library try and reconcile the differences, but have not got very far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants