diff --git a/lang/tunisia/ar/holidays.json b/lang/tunisia/ar/holidays.json index 6739b6ad4..c0f4dca3e 100644 --- a/lang/tunisia/ar/holidays.json +++ b/lang/tunisia/ar/holidays.json @@ -7,13 +7,13 @@ "Women's Day": "عيد المرأة", "Evacuation Day": "عيد الجلاء", "Revolution and Youth Day": "عيد الثورة والشباب", - "Eid al-Fitr": "عيد الفطر المبارك", - "Eid al-Fitr Day 2": "عيد الفطر المبارك", - "Eid al-Fitr Day 3": "عيد الفطر المبارك", - "Eid al-Adha": "عيد الأضحى المبارك", - "Eid al-Adha Day 2": "عيد الأضحى المبارك", - "Eid al-Adha Day 3": "عيد الأضحى المبارك", - "Eid al-Adha Day 4": "عيد الأضحى المبارك", + "Eid al-Fitr": "عيد الفطر", + "Eid al-Fitr Day 2": "عيد الفطر اليوم الثاني", + "Eid al-Fitr Day 3": "عيد الفطر اليوم الثالث", + "Eid al-Adha": "عيد الأضحى", + "Eid al-Adha Day 2": "عيد الأضحى اليوم الثاني", + "Eid al-Adha Day 3": "عيد الأضحى اليوم الثالث", + "Eid al-Adha Day 4": "عيد الأضحى اليوم الرابع", "Islamic New Year": "رأس السنة الهجرية", "Birthday of the Prophet Muhammad": "المولد النبوي الشريف", "Arafat Day": "يوم عرفة (وقفة عيد الأضحى)", diff --git a/lang/tunisia/en/holidays.json b/lang/tunisia/en/holidays.json index 3cfce7770..9a3632685 100644 --- a/lang/tunisia/en/holidays.json +++ b/lang/tunisia/en/holidays.json @@ -7,13 +7,13 @@ "Women's Day": "Women's Day", "Evacuation Day": "Evacuation Day", "Revolution and Youth Day": "Revolution and Youth Day", - "Eid al-Fitr": "Eid al-Fitr", - "Eid al-Fitr Day 2": "Eid al-Fitr", - "Eid al-Fitr Day 3": "Eid al-Fitr", - "Eid al-Adha": "Eid al-Adha", - "Eid al-Adha Day 2": "Eid al-Adha", - "Eid al-Adha Day 3": "Eid al-Adha", - "Eid al-Adha Day 4": "Eid al-Adha", + "Eid al-Fitr": "Eid al-Fitr day 1", + "Eid al-Fitr Day 2": "Eid al-Fitr day 2", + "Eid al-Fitr Day 3": "Eid al-Fitr day 3", + "Eid al-Adha": "Eid al-Adha day 1", + "Eid al-Adha Day 2": "Eid al-Adha day 2", + "Eid al-Adha Day 3": "Eid al-Adha day 3", + "Eid al-Adha Day 4": "Eid al-Adha day 4", "Islamic New Year": "Islamic new year", "Birthday of the Prophet Muhammad": "Birthday of the Prophet Mohamed", "Arafat Day": "Arafat Day", diff --git a/lang/tunisia/fr/holidays.json b/lang/tunisia/fr/holidays.json index dfeb7826e..59d104fa6 100644 --- a/lang/tunisia/fr/holidays.json +++ b/lang/tunisia/fr/holidays.json @@ -7,9 +7,9 @@ "Women's Day": "Fête de la femme", "Evacuation Day": "Fête d'évacuation", "Revolution and Youth Day": "Fête de la Révolution et de la Jeunesse", - "Eid al-Fitr": "Eid al-Fitr", - "Eid al-Fitr Day 2": "Eid al-Fitr", - "Eid al-Fitr Day 3": "Eid al-Fitr", + "Eid al-Fitr": "Eid al-Fitr 1er jour", + "Eid al-Fitr Day 2": "Eid al-Fitr 2e jour", + "Eid al-Fitr Day 3": "Eid al-Fitr 3e jour", "Eid al-Adha": "Eid al-Adha", "Eid al-Adha Day 2": "Eid al-Adha", "Eid al-Adha Day 3": "Eid al-Adha", diff --git a/src/Countries/Tunisia.php b/src/Countries/Tunisia.php index 0d142ed24..a6bac81d2 100644 --- a/src/Countries/Tunisia.php +++ b/src/Countries/Tunisia.php @@ -12,285 +12,216 @@ class Tunisia extends Country implements HasTranslations, Islamic use IslamicCalendar; use Translatable; - private const islamicNewYear = [ - 1970 => "03-08", - 1971 => "02-26", - 1973 => "02-03", - 1972 => "02-15", - 1974 => "01-24", - 1975 => "01-13", - 1976 => "12-22", - 1977 => "12-11", - 1978 => "12-01", - 1979 => "11-20", - 1980 => "11-08", - 1981 => "10-29", - 1982 => "10-18", - 1983 => "10-07", - 1984 => "09-26", - 1985 => "09-15", - 1986 => "09-05", - 1987 => "08-25", - 1988 => "08-13", - 1989 => "08-03", - 1990 => "07-23", - 1991 => "07-12", - 1992 => "07-01", - 1993 => "06-20", - 1994 => "06-09", - 1995 => "05-30", - 1996 => "05-18", - 1997 => "05-08", - 1998 => "04-27", - 1999 => "04-16", - 2000 => "04-05", - 2001 => "03-25", - 2002 => "03-14", - 2003 => "03-04", - 2004 => "02-21", - 2005 => "02-09", - 2006 => "01-30", - 2007 => "01-19", - 2008 => "12-28", - 2009 => "12-17", - 2010 => "12-07", - 2011 => "11-26", - 2012 => "11-14", - 2013 => "11-04", - 2014 => "10-24", - 2015 => "10-14", - 2016 => "10-02", - 2017 => "09-21", - 2018 => "09-11", - 2019 => "08-31", - 2020 => "08-19", - 2021 => "08-09", - 2022 => "07-29", - 2023 => "07-18", - 2024 => "07-07", - 2025 => "06-26", - 2026 => "06-16", - 2027 => "06-05", - 2028 => "05-24", - 2029 => "05-14", - 2030 => "05-03", - 2031 => "04-22", - 2032 => "04-11", - 2033 => "03-31", - 2034 => "03-20", - 2035 => "03-10", - 2036 => "02-27", - 2037 => "02-16" + protected const eidAlFitr = [ + 2005 => '11-04', + 2006 => '10-24', + 2007 => '10-13', + 2008 => '10-02', + 2009 => '09-21', + 2010 => '09-10', + 2011 => '08-30', + 2012 => '08-19', + 2013 => '08-08', + 2014 => '07-28', + 2015 => '07-17', + 2016 => '07-07', + 2017 => '06-26', + 2018 => '06-15', + 2019 => '06-05', + 2020 => '05-24', + 2021 => '05-13', + 2022 => '05-02', + 2023 => '04-20', + 2024 => '04-10', + 2025 => '03-31', + 2026 => '03-21', + 2027 => '03-10', + 2028 => '02-27', + 2029 => '02-15', + 2030 => '02-04', + 2031 => '01-25', + 2032 => '01-15', + 2033 => '01-03', + 2034 => '12-13', + 2035 => '12-02', + 2036 => '11-20', + 2037 => '11-09', ]; - public const prophetMuhammadBirthday = [ - 1970 => "05-17", - 1971 => "05-07", - 1972 => "04-25", - 1973 => "04-14", - 1974 => "04-04", - 1975 => "03-24", - 1976 => "03-02", - 1977 => "02-19", - 1978 => "02-09", - 1979 => "01-29", - 1980 => "01-17", - 1981 => "01-07", - 1982 => "12-27", - 1983 => "12-16", - 1984 => "12-05", - 1985 => "11-24", - 1986 => "11-14", - 1987 => "11-03", - 1988 => "10-22", - 1989 => "10-12", - 1990 => "10-01", - 1991 => "09-20", - 1992 => "09-09", - 1993 => "08-29", - 1994 => "08-18", - 1995 => "08-08", - 1996 => "07-27", - 1997 => "07-17", - 1998 => "07-06", - 1999 => "06-25", - 2000 => "06-14", - 2001 => "06-03", - 2002 => "05-23", - 2003 => "05-13", - 2004 => "05-01", - 2005 => "04-20", - 2006 => "04-10", - 2007 => "03-30", - 2008 => "03-08", - 2009 => "02-25", - 2010 => "02-15", - 2011 => "02-04", - 2012 => "01-23", - 2013 => "01-13", - 2014 => "01-02", - 2015 => "12-23", - 2016 => "12-11", - 2017 => "11-30", - 2018 => "11-20", - 2019 => "11-09", - 2020 => "10-28", - 2021 => "10-18", - 2022 => "10-07", - 2023 => "09-26", - 2024 => "09-15", - 2025 => "09-04", - 2026 => "08-25", - 2027 => "08-14", - 2028 => "08-02", - 2029 => "07-23", - 2030 => "07-12", - 2031 => "07-01", - 2032 => "06-20", - 2033 => "06-09", - 2034 => "05-29", - 2035 => "05-19", - 2036 => "05-07", - 2037 => "04-27" + + protected const arafat = [ + 2005 => '01-21', + 2006 => '01-10', + 2007 => '01-01', + 2008 => '12-09', + 2009 => '11-26', + 2010 => '11-15', + 2011 => '11-05', + 2012 => '10-25', + 2013 => '10-15', + 2014 => '10-04', + 2015 => '09-23', + 2016 => '09-11', + 2017 => '08-31', + 2018 => '08-20', + 2019 => '08-10', + 2020 => '07-30', + 2021 => '07-19', + 2022 => '07-09', + 2023 => '06-27', + 2024 => '06-16', + 2025 => '06-06', + 2026 => '05-26', + 2027 => '05-16', + 2028 => '05-05', + 2029 => '04-24', + 2030 => '04-13', + 2031 => '04-02', + 2032 => '03-21', + 2033 => '03-11', + 2034 => '03-01', + 2035 => '02-18', + 2036 => '02-07', + 2037 => '01-26', + ]; + protected const eidAlAdha = [ + 2005 => '01-22', + 2006 => '01-11', + 2007 => '01-02', + 2008 => '12-10', + 2009 => '11-27', + 2010 => '11-16', + 2011 => '11-06', + 2012 => '10-26', + 2013 => '10-16', + 2014 => '10-05', + 2015 => '09-24', + 2016 => '09-12', + 2017 => '08-31', + 2018 => '08-21', + 2019 => '08-11', + 2020 => '07-31', + 2021 => '07-20', + 2022 => '07-09', + 2023 => '06-28', + 2024 => '06-17', + 2025 => '06-07', + 2026 => '05-27', + 2027 => '05-17', + 2028 => '05-06', + 2029 => '04-25', + 2030 => '04-14', + 2031 => '04-03', + 2032 => '03-22', + 2033 => '03-12', + 2034 => '03-02', + 2035 => '02-19', + 2036 => '02-08', + 2037 => '01-27', + ]; + protected const islamicNewYear = [ + 2005 => '02-10', + 2006 => '01-31', + 2007 => '01-20', + 2008 => '01-10', + 2009 => '12-18', + 2010 => '12-07', + 2011 => '11-27', + 2012 => '11-15', + 2013 => '11-05', + 2014 => '10-25', + 2015 => '10-14', + 2016 => '10-03', + 2017 => '09-22', + 2018 => '09-11', + 2019 => '08-31', + 2020 => '08-20', + 2021 => '08-09', + 2022 => '07-30', + 2023 => '07-19', + 2024 => '07-08', + 2025 => '06-06', + 2026 => '06-17', + 2027 => '06-07', + 2028 => '05-26', + 2029 => '05-15', + 2030 => '05-05', + 2031 => '04-24', + 2032 => '04-12', + 2033 => '04-01', + 2034 => '03-22', + 2035 => '03-12', + 2036 => '02-29', + 2037 => '02-17', ]; - public const eidAlFitr = [ - 1970 => "12-11", - 1971 => "11-30", - 1972 => "11-20", - 1973 => "11-08", - 1974 => "10-28", - 1975 => "10-18", - 1976 => "10-07", - 1977 => "09-15", - 1978 => "09-04", - 1979 => "08-25", - 1980 => "08-13", - 1981 => "08-02", - 1982 => "07-23", - 1983 => "07-12", - 1984 => "06-30", - 1985 => "06-20", - 1986 => "06-09", - 1987 => "05-30", - 1988 => "05-18", - 1989 => "05-07", - 1990 => "04-27", - 1991 => "04-16", - 1992 => "04-04", - 1993 => "03-25", - 1994 => "03-14", - 1995 => "03-03", - 1996 => "02-21", - 1997 => "02-09", - 1998 => "01-30", - 1999 => "01-19", - 2000 => "01-08", - 2001 => "12-28", - 2002 => "12-17", - 2003 => "12-06", - 2004 => "11-26", - 2005 => "11-14", - 2006 => "11-03", - 2007 => "10-24", - 2008 => "10-13", - 2009 => "09-21", - 2010 => "09-10", - 2011 => "08-31", - 2012 => "08-19", - 2013 => "08-08", - 2014 => "07-29", - 2015 => "07-18", - 2016 => "07-07", - 2017 => "06-26", - 2018 => "06-15", - 2019 => "06-05", - 2020 => "05-24", - 2021 => "05-13", - 2022 => "05-03", - 2023 => "04-22", - 2024 => "04-10", - 2025 => "03-31", - 2026 => "03-20", - 2027 => "03-10", - 2028 => "02-27", - 2029 => "02-15", - 2030 => "02-05", - 2031 => "01-25", - 2032 => "01-14", - 2033 => "01-03", - 2034 => "12-23", - 2035 => "12-12", - 2036 => "12-02", - 2037 => "11-20", + protected const ashura = [ + 2005 => '02-19', + 2006 => '02-09', + 2007 => '01-29', + 2008 => '01-19', + 2009 => '12-27', + 2010 => '12-16', + 2011 => '12-06', + 2012 => '11-25', + 2013 => '11-15', + 2014 => '11-04', + 2015 => '10-24', + 2016 => '10-13', + 2017 => '10-02', + 2018 => '09-21', + 2019 => '09-10', + 2020 => '08-30', + 2021 => '08-19', + 2022 => '08-08', + 2023 => '07-28', + 2024 => '07-17', + 2025 => '07-07', + 2026 => '06-26', + 2027 => '06-15', + 2028 => '06-04', + 2029 => '05-24', + 2030 => '05-13', + 2031 => '05-02', + 2032 => '04-20', + 2033 => '04-10', + 2034 => '03-30', + 2035 => '03-19', + 2036 => '03-08', + 2037 => '02-25', ]; - public const eidAlAdha = [ - 1970 => "02-17", - 1971 => "02-06", - 1972 => "01-27", - 1973 => "01-15", - 1974 => "01-04", - 1975 => "12-25", - 1976 => "12-14", - 1977 => "11-22", - 1978 => "11-11", - 1979 => "11-01", - 1980 => "10-20", - 1981 => "10-09", - 1982 => "09-29", - 1983 => "09-18", - 1984 => "09-06", - 1985 => "08-27", - 1986 => "08-16", - 1987 => "08-06", - 1988 => "07-25", - 1989 => "07-14", - 1990 => "07-04", - 1991 => "06-23", - 1992 => "06-11", - 1993 => "06-01", - 1994 => "05-21", - 1995 => "05-10", - 1996 => "04-29", - 1997 => "04-18", - 1998 => "04-08", - 1999 => "03-28", - 2000 => "03-16", - 2001 => "03-06", - 2002 => "02-23", - 2003 => "02-12", - 2004 => "02-02", - 2005 => "01-21", - 2006 => "01-10", - 2007 => "12-31", - 2008 => "12-20", - 2009 => "11-28", - 2010 => "11-17", - 2011 => "11-07", - 2012 => "10-26", - 2013 => "10-15", - 2014 => "10-05", - 2015 => "09-24", - 2016 => "09-13", - 2017 => "09-02", - 2018 => "08-22", - 2019 => "08-12", - 2020 => "07-31", - 2021 => "07-20", - 2022 => "07-10", - 2023 => "06-29", - 2024 => "06-17", - 2025 => "06-07", - 2026 => "05-27", - 2027 => "05-17", - 2028 => "05-05", - 2029 => "04-24", - 2030 => "04-14", - 2031 => "04-03", - 2032 => "03-22", - 2033 => "03-12", - 2034 => "03-01", - 2035 => "02-18", - 2036 => "02-08", - 2037 => "01-27", + protected const prophetMuhammadBirthday = [ + 2005 => '04-21', + 2006 => '04-11', + 2007 => '03-31', + 2008 => '03-20', + 2009 => '03-09', + 2010 => '02-26', + 2011 => '02-16', + 2012 => '02-05', + 2013 => '01-24', + 2014 => '01-13', + 2015 => '12-23', + 2016 => '12-12', + 2017 => '12-01', + 2018 => '11-20', + 2019 => '11-09', + 2020 => '10-29', + 2021 => '10-21', + 2022 => '10-08', + 2023 => '09-28', + 2024 => '09-16', + 2025 => '09-06', + 2026 => '08-26', + 2027 => '08-15', + 2028 => '08-04', + 2029 => '07-25', + 2030 => '07-14', + 2031 => '07-03', + 2032 => '06-21', + 2033 => '06-10', + 2034 => '05-31', + 2035 => '05-21', + 2036 => '05-09', + 2037 => '04-29', ]; /** @@ -331,16 +262,17 @@ protected function allHolidays(int $year): array public function islamicHolidays(int $year): array { - $eidAlFitr = $this->eidAlFitr($year); - $eidAlAdha = $this->eidAlAdha($year); + $eidAlFitr = $this->eidAlFitr(year: $year, totalDays: 2); + $eidAlAdha = $this->eidAlAdha(year: $year, totalDays: 2); return array_merge( [ + 'Arafat Day' => $this->arafat($year), 'Islamic New Year' => $this->islamicNewYear($year), 'Birthday of the Prophet Muhammad' => $this->prophetMuhammadBirthday($year), ], - $this->convertPeriods('Eid al-Adha', $year, $eidAlAdha[0]), - $this->convertPeriods('Eid al-Fitr', $year, $eidAlFitr[0]), + $this->convertPeriods(name: 'Eid al-Fitr', year: $year, period: $eidAlFitr[0]), + $this->convertPeriods(name: 'Eid al-Adha', year: $year, period: $eidAlAdha[0]), ); } diff --git a/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2024____2024_.snap b/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2024____2024_.snap index ba65c6b6c..ea825b988 100644 --- a/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2024____2024_.snap +++ b/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2024____2024_.snap @@ -12,20 +12,32 @@ "date": "2024-04-09" }, { - "name": "Eid al-Fitr", - "date": "2024-04-12" + "name": "Eid al-Fitr day 1", + "date": "2024-04-10" + }, + { + "name": "Eid al-Fitr day 2", + "date": "2024-04-11" }, { "name": "Labour Day", "date": "2024-05-01" }, { - "name": "Eid al-Adha", - "date": "2024-06-20" + "name": "Arafat Day", + "date": "2024-06-16" + }, + { + "name": "Eid al-Adha day 1", + "date": "2024-06-17" + }, + { + "name": "Eid al-Adha day 2", + "date": "2024-06-18" }, { "name": "Islamic new year", - "date": "2024-07-07" + "date": "2024-07-08" }, { "name": "Republic Day", @@ -37,7 +49,7 @@ }, { "name": "Birthday of the Prophet Mohamed", - "date": "2024-09-15" + "date": "2024-09-16" }, { "name": "Evacuation Day", diff --git a/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2025____2025_.snap b/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2025____2025_.snap index c507fd12e..8074f3583 100644 --- a/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2025____2025_.snap +++ b/tests/.pest/snapshots/Countries/TunisiaTest/it_can_calculate_tunisia_holidays_with_data_set___2025____2025_.snap @@ -8,8 +8,12 @@ "date": "2025-03-20" }, { - "name": "Eid al-Fitr", - "date": "2025-04-02" + "name": "Eid al-Fitr day 1", + "date": "2025-03-31" + }, + { + "name": "Eid al-Fitr day 2", + "date": "2025-04-01" }, { "name": "Martyrs' Day", @@ -20,12 +24,20 @@ "date": "2025-05-01" }, { - "name": "Eid al-Adha", - "date": "2025-06-10" + "name": "Arafat Day", + "date": "2025-06-06" }, { "name": "Islamic new year", - "date": "2025-06-26" + "date": "2025-06-06" + }, + { + "name": "Eid al-Adha day 1", + "date": "2025-06-07" + }, + { + "name": "Eid al-Adha day 2", + "date": "2025-06-08" }, { "name": "Republic Day", @@ -37,7 +49,7 @@ }, { "name": "Birthday of the Prophet Mohamed", - "date": "2025-09-04" + "date": "2025-09-06" }, { "name": "Evacuation Day",