Skip to content
Draft
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.md
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>PK</td>
<td></td>
<td><strong>en_PK</strong>, en_US, ur_PK</td>
<td></td>
<td>OPTIONAL, CHRISTIAN</td>
</tr>
<tr>
<td>Palau</td>
Expand Down
104 changes: 93 additions & 11 deletions holidays/countries/pakistan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,33 @@

from holidays.calendars import _CustomIslamicHolidays
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
from holidays.groups import InternationalHolidays, IslamicHolidays
from holidays.constants import OPTIONAL, PUBLIC, CHRISTIAN
from holidays.groups import (
InternationalHolidays,
IslamicHolidays,
ChristianHolidays,
HinduCalendarHolidays,
BuddhistCalendarHolidays,
)
from holidays.holiday_base import HolidayBase


class Pakistan(HolidayBase, InternationalHolidays, IslamicHolidays):
class Pakistan(
HolidayBase,
InternationalHolidays,
IslamicHolidays,
ChristianHolidays,
HinduCalendarHolidays,
BuddhistCalendarHolidays,
):
"""Pakistan holidays.

References:
* <https://en.wikipedia.org/wiki/Public_holidays_in_Pakistan>
* <https://ur.wikipedia.org/wiki/تعطیلات_پاکستان>
* [Public and optional holidays](https://web.archive.org/web/20250118105814/https://cabinet.gov.pk/Detail/OTE2ODBiYmItZmI0MS00NDAwLWE5NGUtYmE1MGVjYzllMzAz)
* [No.10-01/2024-Min-II](https://web.archive.org/web/20241103080918/https://cabinet.gov.pk/SiteImage/Misc/files/Holidays/28-5-24.pdf)
* [Public and optional holidays, 2026](https://cabinet.gov.pk/SiteImage/Misc/files/Holidays/2026/Public-Holidays-2026.pdf)
"""

country = "PK"
Expand All @@ -35,6 +50,7 @@ class Pakistan(HolidayBase, InternationalHolidays, IslamicHolidays):
# Achieved Independence on August 14th, 1947.
start_year = 1948
supported_languages = ("en_PK", "en_US", "ur_PK")
supported_categories = (OPTIONAL, PUBLIC, CHRISTIAN)

def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
"""
Expand All @@ -47,6 +63,9 @@ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
IslamicHolidays.__init__(
self, cls=PakistanIslamicHolidays, show_estimated=islamic_show_estimated
)
ChristianHolidays.__init__(self)
HinduCalendarHolidays.__init__(self)
BuddhistCalendarHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
Expand Down Expand Up @@ -96,6 +115,66 @@ def _populate_public_holidays(self):
self._add_ashura_eve(name)
self._add_ashura_day(name)

def _populate_optional_holidays(self):

# New Year's Day
self._add_new_years_day(tr("New Year's Day"))

# Islamic optional holidays (estimated)
if self._year == 2026:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It doesn't make sense to add holidays for a single year only in this way.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It doesn't make sense to add holidays for a single year only in this way.

@KJhellico - do you recommend I follow the format here:
https://github.com/SaadBazaz/holidays/blob/2300b6e9b5f7f954b2ed35b9376c3595534ebd1f/holidays/countries/pakistan.py#L177-L186

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

self._add_holiday(tr("Shab-e-Meraj (estimated)"), JAN, 17)
self._add_holiday(tr("Shab-e-Barat (estimated)"), FEB, 4)
self._add_holiday(tr("Chehlum (estimated)"), AUG, 4)
self._add_holiday(tr("Giyarvee Shareef (estimated)"), SEP, 23)
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Hindu & Sikh holidays
self._add_holiday(tr("Basant Panchami"), JAN, 23)
self._add_holiday(tr("Shiv Ratri"), FEB, 16)
self._add_holiday(tr("Dulhandi"), MAR, 3)
self._add_holiday(tr("Holi"), MAR, 4)

# Christian holidays

# Good Friday.
self._add_good_friday(tr("Good Friday"))

# Easter Sunday.
self._add_easter_sunday(tr("Easter Sunday"))

# Easter Monday.
self._add_easter_monday(tr("Easter Monday"))
Comment thread
SaadBazaz marked this conversation as resolved.

# Sikh holidays
self._add_holiday(tr("Baisakhi"), APR, 14)

# Bahai holidays
self._add_holiday(tr("Eid-e-Rizwan (Bahai)"), APR, 21)

# Buddhist holidays
self._add_holiday(tr("Buddha Purnima"), MAY, 24)
Comment on lines +153 to +154
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pretty sure this one is a movable holiday, the same goes for Hindu ones


# Parsi holidays
self._add_holiday(tr("Nauroze (Parsi New Year)"), AUG, 15)
self._add_holiday(tr("Birthday of Lord Zoroaster (Khordad Sal)"), AUG, 20)

# Hindu holidays
self._add_holiday(tr("Krishna Janmashtami"), SEP, 4)
self._add_holiday(tr("Durga Puja"), OCT, 19)
self._add_holiday(tr("Dussehra"), OCT, 20)
self._add_holiday(tr("Dussehra Holiday"), OCT, 26)
self._add_diwali(tr("Diwali"))

# Sikh holidays
self._add_holiday(tr("Birthday of Guru Nanak Dev Ji"), NOV, 24)
self._add_holiday(tr("Birthday of Guru Valmiki Ji"), NOV, 30)

def _populate_christian_holidays(self):
# Christmas Day.
self._add_christmas_day(tr("Christmas Day"))

# Day after Christmas
self._add_holiday_dec_26(tr("Day after Christmas"))


class PK(Pakistan):
pass
Expand All @@ -109,15 +188,16 @@ class PakistanIslamicHolidays(_CustomIslamicHolidays):
# https://web.archive.org/web/20250724060822/https://www.timeanddate.com/holidays/pakistan/ashura
ASHURA_DATES_CONFIRMED_YEARS = (2005, 2025)
ASHURA_DATES = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the source of dates information? (I see some discrepancies with Timeanddate, which isn't 100% reliable either).

2005: (FEB, 18),
2006: (FEB, 8),
2007: (JAN, 28),
2008: (JAN, 18),
2009: ((JAN, 6), (DEC, 26)),
2012: (NOV, 23),
2018: (SEP, 21),
2022: (AUG, 9),
2005: (FEB, 19),
2006: (FEB, 9),
2007: (JAN, 29),
2008: (JAN, 19),
2009: ((JAN, 7), (DEC, 27)),
2012: (NOV, 24),
2018: (SEP, 20),
2022: (AUG, 8),
2025: (JUL, 6),
2026: (JUN, 25),
}

# https://web.archive.org/web/20250724060629/https://www.timeanddate.com/holidays/pakistan/eid-ul-azha
Expand All @@ -138,6 +218,7 @@ class PakistanIslamicHolidays(_CustomIslamicHolidays):
2023: (JUN, 29),
2024: (JUN, 17),
2025: (JUN, 7),
2026: (MAY, 27),
}

# https://web.archive.org/web/20250724060834/https://www.timeanddate.com/holidays/pakistan/eid-ul-fitr-1
Expand All @@ -155,10 +236,10 @@ class PakistanIslamicHolidays(_CustomIslamicHolidays):
2022: (MAY, 3),
2023: (APR, 22),
2025: (MAR, 31),
2026: (MAR, 21),
}

# https://web.archive.org/web/20250724061027/https://www.timeanddate.com/holidays/pakistan/eid-milad-un-nabi

MAWLID_DATES_CONFIRMED_YEARS = (2005, 2024)
MAWLID_DATES = {
2005: (APR, 22),
Expand All @@ -178,4 +259,5 @@ class PakistanIslamicHolidays(_CustomIslamicHolidays):
2022: (OCT, 9),
2023: (SEP, 29),
2024: (SEP, 17),
2026: (AUG, 25),
}
115 changes: 102 additions & 13 deletions holidays/locale/en_PK/LC_MESSAGES/PK.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.70\n"
"Project-Id-Version: Holidays 0.93\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2025-03-28 22:18+0500\n"
"PO-Revision-Date: 2025-03-29 00:00+0500\n"
"Last-Translator: Wasif Shahzad <wasif_shahzad_1@outlook.com>\n"
"PO-Revision-Date: 2026-03-16 03:05+0500\n"
"Last-Translator: Saad Bazaz <bazaz@grayhat.studio>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_PK\n"
"MIME-Version: 1.0\n"
Expand All @@ -35,44 +35,133 @@ msgstr ""

#. Kashmir Solidarity Day.
msgid "Kashmir Solidarity Day"
msgstr ""
msgstr "Kashmir Solidarity Day"

#. Pakistan Day.
msgid "Pakistan Day"
msgstr ""
msgstr "Pakistan Day"

#. Labor Day.
msgid "Labour Day"
msgstr ""
msgstr "Labour Day"

#. Youm-e-Takbeer.
msgid "Youm-e-Takbeer"
msgstr ""
msgstr "Youm-e-Takbeer"

#. Independence Day.
msgid "Independence Day"
msgstr ""
msgstr "Independence Day"

#. Iqbal Day.
msgid "Iqbal Day"
msgstr ""
msgstr "Iqbal Day"

#. Quaid-e-Azam Day.
msgid "Quaid-e-Azam Day"
msgstr ""
msgstr "Quaid-e-Azam Day"

#. Eid al-Fitr.
msgid "Eid-ul-Fitr"
msgstr ""
msgstr "Eid-ul-Fitr"

#. Eid al-Adha.
msgid "Eid-ul-Adha"
msgstr ""
msgstr "Eid-ul-Adha"

#. Prophet's Birthday.
msgid "Eid Milad-un-Nabi"
msgstr ""
msgstr "Eid Milad-un-Nabi"

#. Ashura.
msgid "Ashura"
msgstr "Ashura"

#. New Year's Day
msgid "New Year's Day"
msgstr "New Year's Day"

msgid "Shab-e-Meraj (estimated)"
msgstr "Shab-e-Meraj (estimated)"

msgid "Shab-e-Barat (estimated)"
msgstr "Shab-e-Barat (estimated)"

msgid "Chehlum (estimated)"
msgstr "Chehlum (estimated)"

msgid "Giyarvee Shareef (estimated)"
msgstr "Giyarvee Shareef (estimated)"

#. Hindu & Sikh holidays
msgid "Basant Panchami"
msgstr "Basant Panchami"

msgid "Shiv Ratri"
msgstr "Shiv Ratri"

msgid "Dulhandi"
msgstr "Dulhandi"

msgid "Holi"
msgstr "Holi"

#. Christian holidays
msgid "Good Friday"
msgstr "Good Friday"

msgid "Easter Sunday"
msgstr "Easter Sunday"

msgid "Easter Monday"
msgstr "Easter Monday"

#. Sikh holidays
msgid "Baisakhi"
msgstr "Baisakhi"

#. Bahai holidays
msgid "Eid-e-Rizwan (Bahai)"
msgstr "Eid-e-Rizwan (Bahai)"

#. Buddhist holidays
msgid "Buddha Purnima"
msgstr "Buddha Purnima"

#. Parsi holidays
msgid "Nauroze (Parsi New Year)"
msgstr "Nauroze (Parsi New Year)"

msgid "Birthday of Lord Zoroaster (Khordad Sal)"
msgstr "Birthday of Lord Zoroaster (Khordad Sal)"

#. Hindu holidays
msgid "Krishna Janmashtami"
msgstr "Krishna Janmashtami"

msgid "Durga Puja"
msgstr "Durga Puja"

msgid "Dussehra"
msgstr "Dussehra"

msgid "Dussehra Holiday"
msgstr "Dussehra Holiday"

msgid "Diwali"
msgstr "Diwali"

#. Sikh holidays
msgid "Birthday of Guru Nanak Dev Ji"
msgstr "Birthday of Guru Nanak Dev Ji"

msgid "Birthday of Guru Valmiki Ji"
msgstr "Birthday of Guru Valmiki Ji"

#. Christmas Day.
msgid "Christmas Day"
msgstr ""

#. Day after Christmas
msgid "Day after Christmas"
msgstr "Day after Christmas"
Loading