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

[feat] implement iran holidays #128

Closed
wants to merge 4 commits into from
Closed

Conversation

aryala7
Copy link

@aryala7 aryala7 commented Jan 19, 2024

Contributing a new country ?

  • Have you checked to ensure there aren't other open Pull Requests for the same country?
  1. Create a new class in the Countries directory. It should extend the Country class.
  2. Add a test for the new country in the tests directory.
  3. Run the tests so a snapshot gets created.
  4. Verify the result in the newly created snapshot is correct.

@aryala7
Copy link
Author

aryala7 commented Jan 20, 2024

@alisalehi1380 thanks for your review

@alisalehi1380
Copy link
Contributor

And the last point, because the main Iranian calendar is the Solar Hijri calendar, using the dates listed in Wikipedia (according to the Gregorian calendar) is limited and has a delay of one day.
For this reason, we have to change these dates so that when we convert to the solar date, it is correct.
Unfortunately, when the output of your code in the verta package (one of the most famous date conversion packages) is used to convert to solar date, the displayed date is not correct!

Left my code and Right your code.
Screenshot 2024-01-20 13241a2
As this picture shows, only 3 of the Gregorian dates on Wikipedia are correct and useful!

I have taken the time to find all these issues and fixed them in my pull request. #146
I would like to participate in this project. Do as you see fit.
@Nielsvanpach

Regards, Ali Salehi

@aryala7
Copy link
Author

aryala7 commented Jan 21, 2024

@alisalehi1380 Are you sure you checked these dates with the latest version of my changes because this problem has been fixed in the latest version

@alisalehi1380
Copy link
Contributor

@aryala7 Yes, I've solved it in the pull request! 😊

src/Countries/Iran.php Outdated Show resolved Hide resolved
->setTimezone('Asia/Tehran');

return [
//add more holidays
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which ones are missing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nielsvanpach Currently, Islamic holidays cannot be added because they are not fixed every year.For example, some holidays may occur 1 or 2 days earlier or later with the sighting of the moon

tests/Countries/IranTest.php Outdated Show resolved Hide resolved
aryala7 and others added 2 commits January 27, 2024 14:37
Co-authored-by: Niels Vanpachtenbeke <[email protected]>
Co-authored-by: Niels Vanpachtenbeke <[email protected]>
@Nielsvanpach
Copy link
Member

Merged another PR for Iran. Feel free to open a new PR with needed changes! Thanks.

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

Successfully merging this pull request may close these issues.

3 participants