Skip to content

Commit

Permalink
add Eve dates for Turkey
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Feb 21, 2024
1 parent db02e85 commit 7a0a8ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
8 changes: 4 additions & 4 deletions lang/turkey/tr/holidays.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"New Year's Day": "Yılbaşı",
"Eid al-Fitr": "Ramazan Bayramı Arifesi",
"Eid al-Fitr Day 1": "Ramazan Bayramı 1. Gün",
"Eid al-Fitr Eve": "Ramazan Bayramı Arifesi",
"Eid al-Fitr": "Ramazan Bayramı 1. Gün",
"Eid al-Fitr Day 2": "Ramazan Bayramı 2. Gün",
"Eid al-Fitr Day 3": "Ramazan Bayramı 3. Gün",
"National Sovereignty and Children's Day": "Ulusal Egemenlik ve Çocuk Bayramı",
"Labor and Solidarity Day": "Emek ve Dayanışma Günü",
"Commemoration of Atatürk, Youth and Sports Day": "Atatürk'ü Anma, Gençlik ve Spor Bayramı",
"Eid al-Adha": "Kurban Bayramı Arifesi",
"Eid al-Adha Day 1": "Kurban Bayramı 1. Gün",
"Eid al-Adha Eve": "Kurban Bayramı Arifesi",
"Eid al-Adha": "Kurban Bayramı 1. Gün",
"Eid al-Adha Day 2": "Kurban Bayramı 2. Gün",
"Eid al-Adha Day 3": "Kurban Bayramı 3. Gün",
"Eid al-Adha Day 4": "Kurban Bayramı 4. Gün",
Expand Down
5 changes: 5 additions & 0 deletions src/Countries/Turkey.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ protected function allHolidays(int $year): array

public function islamicHolidays(int $year): array
{
$eidAlFitr = $this->eidAlFitr($year);
$eidAlAdha = $this->eidAlAdha($year);

$holidays = [
'Eid al-Fitr Eve' => $eidAlFitr->first()?->subDay()->toImmutable(),
'Eid al-Fitr' => $this->eidAlFitr($year),
'Eid al-Adha Eve' => $eidAlAdha->first()?->subDay()->toImmutable(),
'Eid al-Adha' => $this->eidAlAdha($year),
];

Expand Down
15 changes: 1 addition & 14 deletions tests/Countries/TurkeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@
use Carbon\CarbonImmutable;
use Spatie\Holidays\Holidays;

/**it('can calculate turkey holidays', function ($year) {
CarbonImmutable::setTestNow($year.'-01-01');
$holidays = Holidays::for(country: 'tr')->get();
expect($holidays)
->toBeArray()
->not()->toBeEmpty();
expect(formatDates($holidays))->toMatchSnapshot();
})->with([1970, 1973, 1974, 1975, 1999, 2000, 2001, 2005, 2006, 2007, 2008, 2009, 2016, 2017, 2021, 2022, 2023, 2024, 2025, 2032, 2033, 2034, 2037]);
*/

it('can calculate turkey holidays', function ($year) {
CarbonImmutable::setTestNow($year.'-01-01');

Expand All @@ -28,4 +15,4 @@
->not()->toBeEmpty();

expect(formatDates($holidays))->toMatchSnapshot();
})->with([2024]);
})->with([1970, 1973, 1974, 1975, 1999, 2000, 2001, 2005, 2006, 2007, 2008, 2009, 2016, 2017, 2021, 2022, 2023, 2024, 2025, 2032, 2033, 2034, 2037]);

0 comments on commit 7a0a8ef

Please sign in to comment.