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

Update Iran holidays #2234

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ All other default values are highlighted with bold:
* - Iran
- IR
-
- en_US, **fa**
- en_US, **fa_IR**
-
* - Ireland
- IE
Expand Down
6 changes: 6 additions & 0 deletions holidays/calendars/persian.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class _Persian:
START_YEAR = 1901
END_YEAR = 2100

def is_leap_year(self, year: int) -> bool:
"""
Is Persian year that begins in the specified Gregorian year a leap year.
"""
return (year % 33) in {3, 7, 11, 16, 20, 24, 28, 32}

def new_year_date(self, year: int) -> Optional[date]:
"""
Return Gregorian date of Persian new year (1 Farvardin) in a given Gregorian year.
Expand Down
Loading
Loading