Skip to content

Commit

Permalink
Merge branch 'spatie:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
amralsaleeh authored Feb 1, 2024
2 parents 3cf914a + 914ae68 commit ea050e4
Show file tree
Hide file tree
Showing 237 changed files with 8,320 additions and 85 deletions.
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,82 @@

All notable changes to `holidays` will be documented in this file.

## 1.4.0 - 2024-01-30

### What's Changed

* Add Montenegro holidays by @Rkishahaha in https://github.com/spatie/holidays/pull/171
* Add Angola Holidays by @monteirofutila in https://github.com/spatie/holidays/pull/89
* add wales, england, scotland and northern ireland by @SimonBarrettACT in https://github.com/spatie/holidays/pull/162
* Add Chile Holidays by @AndresReyesDev in https://github.com/spatie/holidays/pull/88
* Added Kenyan holidays by @PhilN8 in https://github.com/spatie/holidays/pull/69
* Add vietnamese holidays by @kevinb1989 in https://github.com/spatie/holidays/pull/115
* Germany: Adding local for EN, FR, NL by @arnebr in https://github.com/spatie/holidays/pull/183
* Support for Taiwan holidays by @takeshiyu in https://github.com/spatie/holidays/pull/124
* Fixing README.md to update region parameter in country constructor to a working example by @arnebr in https://github.com/spatie/holidays/pull/184
* Draft: Add Support for Switzerland by @Martin-Welte in https://github.com/spatie/holidays/pull/49
* Add Tanzania national holiday by @alphaolomi in https://github.com/spatie/holidays/pull/98
* Switzerland: add missing holidays to "ch-ur" region by @Kenny1291 in https://github.com/spatie/holidays/pull/191
* Germany: Setting some historical holidays by @arnebr in https://github.com/spatie/holidays/pull/188
* feat: Add Bangla language support for Bangladeshi holidays by @jfBiswajit in https://github.com/spatie/holidays/pull/182
* add indonesia holiday by @ddouble-d in https://github.com/spatie/holidays/pull/66

### New Contributors

* @Rkishahaha made their first contribution in https://github.com/spatie/holidays/pull/171
* @monteirofutila made their first contribution in https://github.com/spatie/holidays/pull/89
* @SimonBarrettACT made their first contribution in https://github.com/spatie/holidays/pull/162
* @AndresReyesDev made their first contribution in https://github.com/spatie/holidays/pull/88
* @PhilN8 made their first contribution in https://github.com/spatie/holidays/pull/69
* @kevinb1989 made their first contribution in https://github.com/spatie/holidays/pull/115
* @takeshiyu made their first contribution in https://github.com/spatie/holidays/pull/124
* @alphaolomi made their first contribution in https://github.com/spatie/holidays/pull/98
* @Kenny1291 made their first contribution in https://github.com/spatie/holidays/pull/191
* @jfBiswajit made their first contribution in https://github.com/spatie/holidays/pull/182
* @ddouble-d made their first contribution in https://github.com/spatie/holidays/pull/66

**Full Changelog**: https://github.com/spatie/holidays/compare/1.3.0...1.4.0

## 1.3.0 - 2024-01-25

### What's Changed

* Add Ukrainian holidays by @kapi14 in https://github.com/spatie/holidays/pull/112
* Added Turkey holidays by @thecaliskan in https://github.com/spatie/holidays/pull/70
* Added has helper by @thecaliskan in https://github.com/spatie/holidays/pull/170
* Add Slovakia holidays by @patressz in https://github.com/spatie/holidays/pull/102
* Add support for multi languages by @Nielsvanpach in https://github.com/spatie/holidays/pull/177
* Add latvian holidays by @IvarsSaudinis in https://github.com/spatie/holidays/pull/169
* Added Colombia Holidays by @alvleont in https://github.com/spatie/holidays/pull/55
* Add Finnish Holidays by @ConnySjoblom in https://github.com/spatie/holidays/pull/85
* Add Japan support by @mkokio in https://github.com/spatie/holidays/pull/160
* Add United States Holidays by @arcdigital in https://github.com/spatie/holidays/pull/26
* Add Serbian holidays by @knubbe82 in https://github.com/spatie/holidays/pull/107
* Add El Salvador Holidays by @vlltr in https://github.com/spatie/holidays/pull/93
* Belarus Holidays by @Jampire in https://github.com/spatie/holidays/pull/156
* Adding German holidays by @arnebr in https://github.com/spatie/holidays/pull/8
* Add Australian Holidays by @patrickomeara in https://github.com/spatie/holidays/pull/43
* Update Australia.php by @OnyileFelix1 in https://github.com/spatie/holidays/pull/178
* Bug fix: calculating orthodox easter by @Nielsvanpach in https://github.com/spatie/holidays/pull/180

### New Contributors

* @kapi14 made their first contribution in https://github.com/spatie/holidays/pull/112
* @patressz made their first contribution in https://github.com/spatie/holidays/pull/102
* @IvarsSaudinis made their first contribution in https://github.com/spatie/holidays/pull/169
* @alvleont made their first contribution in https://github.com/spatie/holidays/pull/55
* @ConnySjoblom made their first contribution in https://github.com/spatie/holidays/pull/85
* @mkokio made their first contribution in https://github.com/spatie/holidays/pull/160
* @arcdigital made their first contribution in https://github.com/spatie/holidays/pull/26
* @knubbe82 made their first contribution in https://github.com/spatie/holidays/pull/107
* @vlltr made their first contribution in https://github.com/spatie/holidays/pull/93
* @Jampire made their first contribution in https://github.com/spatie/holidays/pull/156
* @arnebr made their first contribution in https://github.com/spatie/holidays/pull/8
* @patrickomeara made their first contribution in https://github.com/spatie/holidays/pull/43
* @OnyileFelix1 made their first contribution in https://github.com/spatie/holidays/pull/178

**Full Changelog**: https://github.com/spatie/holidays/compare/1.2.0...1.3.0

## 1.2.0 - 2024-01-23

### What's Changed
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ use Spatie\Holidays\Holidays;
$holidays = Holidays::for(country: 'be', year: 2024))->get();
```

### Getting holidays in a specific language

```php
use Spatie\Holidays\Holidays;

$holidays = Holidays::for(country: 'be', locale: 'fr'))->get();
```

If the locale is not supported for a country, an exception will be thrown.

### Determining if a date is a holiday

If you need to see if a date is a holiday, you can use the `isHoliday` method.
Expand All @@ -88,6 +98,17 @@ use Spatie\Holidays\Holidays;
Holidays::for('be')->getName('2024-01-01'); // Nieuwjaar
```

### Determining whether a country is supported

To verify whether a country is supported, you can use the `has` method.

```php
use Spatie\Holidays\Holidays;

Holidays::has('be'); // true
Holidays::has('unknown'); // false
```

### Package limitations
1. Islamic holidays are not supported (yet)

Expand All @@ -101,18 +122,19 @@ This is a community driven package. If you find any errors, please create an iss
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.
5. If the country has multiple languages, add a file in the `lang/` directory.

In case your country has specific rules for calculating holidays,
for example region specific holidays, you can pass this to the constructor of your country class.

```php
$holidays = Holidays::for(Austria::make(region: 'de-bw'))->get();
$holidays = Holidays::for(Germany::make(region: 'DE-BW'))->get();
```

The value, `de-bw`, will be passed to the region parameter of the constructor of a country.
The value, `DE-BW`, will be passed to the region parameter of the constructor of a country.

```php
class Austria extends Country
class Germany extends Country
{
protected function __construct(
protected ?string $region = null,
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
],
"require": {
"php": "^8.1",
"nesbot/carbon": "^2.72.1",
"ext-calendar": "*"
"ext-intl": "*",
"nesbot/carbon": "^2.72.1"
},
"require-dev": {
"laravel/pint": "^1.0",
"laravel/prompts": "^0.1.15",
"pestphp/pest": "^2.31",
"phpstan/phpstan": "^1.10.56",
"spatie/invade": "^2.0",
"spatie/ray": "^1.40.1",
"symfony/var-dumper": "^6.4"
},
Expand Down
10 changes: 10 additions & 0 deletions lang/bangladesh/bn/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"International Mother Language Day": "Antorjatik Matribhasha Dibos",
"Birthday of Sheikh Mujibur Rahman": "Shekh Mujibur Rahmaner Jonmodin",
"Independence Day": "Swadhinota Dibos",
"Bengali New Year": "Bangla Noboborsho",
"May Day": "Antorjatik Shrom Dibos",
"National Mourning Day": "Jatiyo Shok Dibos",
"Victory Day": "Bijoy Dibos",
"Christmas Day": "Borodin"
}
10 changes: 10 additions & 0 deletions lang/bangladesh/en/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"International Mother Language Day": "International Mother Language Day",
"Birthday of Sheikh Mujibur Rahman": "Birthday of Sheikh Mujibur Rahman",
"Independence Day": "Independence Day",
"Bengali New Year": "Bengali New Year",
"May Day": "May Day",
"National Mourning Day": "National Mourning Day",
"Victory Day": "Victory Day",
"Christmas Day": "Christmas Day"
}
12 changes: 12 additions & 0 deletions lang/belarus/be-latn/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Новы год": "Novy hod",
"Новы год (другі дзень)": "Novy hod (druhi dzień)",
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Naradžeńnie Chrystova (pravasłaŭnaje Rastvo)",
"Дзень жанчын": "Dzień žančyn",
"Свята працы": "Sviata pracy",
"Дзень Перамогі": "Dzień Pieramohi",
"Дзень Незалежнасці": "Dzień Niezaležnaści",
"Дзень Кастрычніцкай рэвалюцыі": "Dzień Kastryčnickaj revalucyi",
"Нараджэнне Хрыстова (каталіцкае Раство)": "Naradžeńnie Chrystova (katalickaje Rastvo)",
"Радаўніца": "Radaŭnica"
}
12 changes: 12 additions & 0 deletions lang/belarus/en/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Новы год": "New Year's Day",
"Новы год (другі дзень)": "New Year's Day (second day)",
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Orthodox Christmas",
"Дзень жанчын": "Women's Day",
"Свята працы": "Labor Day",
"Дзень Перамогі": "Victory Day",
"Дзень Незалежнасці": "Independence Day",
"Дзень Кастрычніцкай рэвалюцыі": "October Revolution Day",
"Нараджэнне Хрыстова (каталіцкае Раство)": "Catholic Christmas",
"Радаўніца": "Radaunitsa"
}
12 changes: 12 additions & 0 deletions lang/belarus/ru/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Новы год": "Новый год",
"Новы год (другі дзень)": "Новый год (второй день)",
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Православное Рождество",
"Дзень жанчын": "Международный женский день",
"Свята працы": "День труда",
"Дзень Перамогі": "День Победы",
"Дзень Незалежнасці": "День Независимости",
"Дзень Кастрычніцкай рэвалюцыі": "День Октябрьской революции",
"Нараджэнне Хрыстова (каталіцкае Раство)": "Католическое Рождество",
"Радаўніца": "Радуница"
}
12 changes: 12 additions & 0 deletions lang/belgium/fr/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Nieuwjaar": "Jour de l'An",
"Dag van de Arbeid": "Fête du Travail",
"Nationale Feestdag": "Fête nationale",
"OLV Hemelvaart": "Assomption",
"Allerheiligen": "Toussaint",
"Wapenstilstand": "Armistice",
"Kerstmis": "Noël",
"Paasmaandag": "Lundi de Pâques",
"OLH Hemelvaart": "Ascension",
"Pinkstermaandag": "Lundi de Pentecôte"
}
23 changes: 23 additions & 0 deletions lang/egypt/ar/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"New Year\n's Day": "يوم رأس السنة",
"Coptic Christmas": "عيد الميلاد القبطي",
"Revolution Day January 25": "عيد ثورة 25 يناير",
"March Equinox": "اعتدال مارس",
"Sinai Liberation": "تحرير سيناء",
"Labor": "العمل",
"Coptic Good": "الصالح القبطي",
"Coptic Holy": "المقدس القبطي",
"Coptic Easter": "عيد الفصح القبطي",
"Spring Festival": "مهرجان الربيع",
"June Solstice": "انقلاب يونيو",
"June 30 Revolution": "ثورة 30 يونيو",
"Day off for June 30 Revolution": "يوم عطلة بمناسبة ثورة 30 يونيو",
"Revolution Day July 23": "عيد ثورة 23 يوليو",
"Day off for Revolution Day July 23": "يوم عطلة بمناسبة عيد ثورة 23 يوليو",
"Flooding of the Nile": "فيضان النيل",
"Nayrouz": "النيروز",
"September Equinox": "الاعتدال في سبتمبر",
"Armed Forces": "القوات المسلحة",
"Day off for Armed Forces": "يوم عطلة للقوات المسلحة",
"December Solstice": "الانقلاب الشمسي في ديسمبر"
}
15 changes: 15 additions & 0 deletions lang/finland/sv/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Uudenvuodenpäivä": "Nyårsdagen",
"Loppiainen": "Trettondagen",
"Pitkäperjantai": "Långfredagen",
"Pääsiäispäivä": "Påskdagen",
"Toinen pääsiäispäivä": "Annandag påsk",
"Vappu": "Första maj",
"Helatorstai": "Kristi himmelsfärdsdag",
"Helluntaipäivä": "Pingst",
"Juhannuspäivä": "Midsommardagen",
"Pyhäinpäivä": "Alla helgons dag",
"Itsenäisyyspäivä": "Självständighetsdagen",
"Joulupäivä": "Juldagen",
"Tapaninpäivä": "Annandag jul"
}
22 changes: 22 additions & 0 deletions lang/germany/en/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Neujahr": "New Year",
"Heilige Drei Könige": "Epiphany",
"Tag der Arbeit": "Labour Day",
"Himmelfahrt": "Ascension Day",
"Pfingstmontag": "Whit Monday",
"Pfingstsonntag": "Whit Sunday",
"Fronleichnam": "Corpus Christi",
"Mariä Himmelfahrt": "Assumption of Mary",
"Tag der Deutschen Einheit": "German Unity Day",
"Reformationstag": "Reformation Day",
"Allerheiligen": "All Saints' Day",
"Buß- und Bettag": "Repentance and Prayer Day",
"1. Weihnachtstag": "Christmas Day",
"2. Weihnachtstag": "Second Day of Christmas",
"Ostermontag": "Easter Monday",
"Karfreitag": "Good Friday",
"Ostersonntag": "Easter Sunday",
"Internationaler Frauentag": "International Women's Day",
"Weltkindertag": "World Children's Day",
"Tag der Befreiung": "Victory in Europe Day"
}
22 changes: 22 additions & 0 deletions lang/germany/fr/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Neujahr": "Jour de l'An",
"Heilige Drei Könige": "Épiphanie",
"Tag der Arbeit": "Fête du Travail",
"Himmelfahrt": "Ascension",
"Pfingstmontag": "Lundi de Pentecôte",
"Pfingstsonntag": "Dimanche de Pentecôte",
"Fronleichnam": "Fête-Dieu",
"Mariä Himmelfahrt": "Assomption",
"Tag der Deutschen Einheit": "Jour de l'Unité allemande",
"Reformationstag": "Fête de la Réformation",
"Allerheiligen": "Toussaint",
"Buß- und Bettag": "Jour de pénitence et de prières",
"1. Weihnachtstag": "Noël",
"2. Weihnachtstag": "Lendemain de Noël",
"Ostermontag": "Lundi de Pâques",
"Karfreitag": "Vendredi Saint",
"Ostersonntag": "Dimanche de Pâques",
"Internationaler Frauentag": "Journée internationale des femmes",
"Weltkindertag": "Journée de l'enfance",
"Tag der Befreiung": "Fête de la Victoire"
}
22 changes: 22 additions & 0 deletions lang/germany/nl/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Neujahr": "Nieuwjaar",
"Heilige Drei Könige": "Driekoningen",
"Tag der Arbeit": "Dag van de Arbeid",
"Himmelfahrt": "Hemelvaart",
"Pfingstmontag": "Tweede pinksterdag",
"Pfingstsonntag": "Eerste Pinksterdag",
"Fronleichnam": "Sacramentsdag",
"Mariä Himmelfahrt": "Mariahemelvaart",
"Tag der Deutschen Einheit": "Dag van de Duitse eenheid",
"Reformationstag": "Hervormingsdag",
"Allerheiligen": "Allerheiligen",
"Buß- und Bettag": "Boete- en Biddag",
"1. Weihnachtstag": "Eerste kerstdag",
"2. Weihnachtstag": "Tweede kerstdag",
"Ostermontag": "Tweede paasdag",
"Karfreitag": "Goede Vrijdag",
"Ostersonntag": "Eerste paasdag",
"Internationaler Frauentag": "Internationale vrouwendag",
"Weltkindertag": "Kinderdag",
"Tag der Befreiung": "Bevrijdingsdag"
}
18 changes: 18 additions & 0 deletions lang/montenegro/en/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Nova godina - prvi dan": "New Year - first day",
"Nova godina - drugi dan": "New Year - second day",
"Badnji dan": "Christmas Eve",
"Božić - prvi dan": "Christmas - first day",
"Božić - drugi dan": "Christmas - second day",
"Praznik rada - prvi dan": "Labour Day - first day",
"Praznik rada - drugi dan": "Labour Day - second day",
"Veliki petak": "Good Friday",
"Vaskrs": "Easter",
"Vaskršnji ponedjeljak": "Easter Monday",
"Dan nezavisnosti - prvi dan": "Independence Day - first day",
"Dan nezavisnosti - drugi dan": "Independence Day - second day",
"Dan državnosti - prvi dan": "National Day - first day",
"Dan državnosti - drugi dan": "National Day - second day",
"Njegošev dan - prvi dan": "Njegoš's Day - first day",
"Njegošev dan - drugi dan": "Njegoš's Day - second day"
}
18 changes: 18 additions & 0 deletions lang/montenegro/sr/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Nova godina - prvi dan": "Nova godina - prvi dan",
"Nova godina - drugi dan": "Nova godina - drugi dan",
"Badnji dan": "Badnji dan",
"Božić - prvi dan": "Božić - prvi dan",
"Božić - drugi dan": "Božić - drugi dan",
"Praznik rada - prvi dan": "Praznik rada - prvi dan",
"Praznik rada - drugi dan": "Praznik rada - drugi dan",
"Veliki petak": "Veliki petak",
"Vaskrs": "Vaskrs",
"Vaskršnji ponedjeljak": "Vaskršnji ponedeljak",
"Dan nezavisnosti - prvi dan": "Dan nezavisnosti - prvi dan",
"Dan nezavisnosti - drugi dan": "Dan nezavisnosti - drugi dan",
"Dan državnosti - prvi dan": "Dan državnosti - prvi dan",
"Dan državnosti - drugi dan": "Dan državnosti - drugi dan",
"Njegošev dan - prvi dan": "Njegošev dan - prvi dan",
"Njegošev dan - drugi dan": "Njegošev dan - drugi dan"
}
Loading

0 comments on commit ea050e4

Please sign in to comment.