Skip to content

Commit 898164e

Browse files
authored
Merge branch 'nager:main' into main
2 parents c941445 + 03fbf73 commit 898164e

File tree

8 files changed

+135
-35
lines changed

8 files changed

+135
-35
lines changed

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,18 @@ updates:
1818
- "enhancement"
1919
# Allow up to 5 open pull requests for nuget dependencies
2020
open-pull-requests-limit: 5
21+
22+
- package-ecosystem: github-actions
23+
directory: "/"
24+
schedule:
25+
interval: "daily"
26+
reviewers:
27+
- "tinohager"
28+
- "samtrion"
29+
commit-message:
30+
prefix: chore
31+
labels:
32+
- "dependencies"
33+
- "enhancement"
34+
# Allow up to 5 open pull requests for nuget dependencies
35+
open-pull-requests-limit: 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Dependabot GitHub Actions Auto Merge
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
branches: [ main ]
8+
9+
permissions:
10+
pull-requests: write
11+
contents: write
12+
13+
jobs:
14+
dependabot:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.actor == 'dependabot[bot]' }}
17+
steps:
18+
- name: Dependabot metadata
19+
id: dependabot-metadata
20+
uses: dependabot/fetch-metadata@v2
21+
- name: Enable auto-merge for Dependabot PRs
22+
if: ${{steps.dependabot-metadata.outputs.package-ecosystem == 'github_actions'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/dotnet.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
paths:
1111
- 'src/**'
12+
- '.github/workflows/**'
1213
branches: [ main ]
1314

1415
jobs:

src/Nager.Date.ArchitectureTest/Nager.Date.ArchitectureTest.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
13-
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
14-
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
13+
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
14+
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
1515
<PackageReference Include="TngTech.ArchUnitNET.MSTestV2" Version="0.11.1" />
1616
</ItemGroup>
1717

src/Nager.Date.UnitTest/Nager.Date.UnitTest.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
13-
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
14-
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
13+
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
14+
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Nager.Date/HolidayProviders/AustraliaHolidayProvider.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
5454
var firstMondayInOctober = DateHelper.FindDay(year, Month.October, DayOfWeek.Monday, Occurrence.First);
5555
var firstTuesdayInNovember = DateHelper.FindDay(year, Month.November, DayOfWeek.Tuesday, Occurrence.First);
5656

57-
//var newYearsDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1));
58-
//var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2));
59-
//var boxingDay = new DateTime(year, 12, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2));
60-
//var australiaDay = new DateTime(year, 1, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1));
61-
6257
var weekendObservedRuleSet = new ObservedRuleSet
6358
{
6459
Saturday = date => date.AddDays(2), Sunday = date => date.AddDays(1),
@@ -332,6 +327,7 @@ private HolidaySpecification[] MonarchBirthday(int year)
332327
case 2019:
333328
case 2021:
334329
case 2023:
330+
case 2024:
335331
{
336332
var lastFridayInSeptember = DateHelper.FindLastDay(year, Month.September, DayOfWeek.Friday);
337333

src/Nager.Date/HolidayProviders/GermanyHolidayProvider.cs

+18
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,30 @@ private HolidaySpecification ReformationDay(int year)
297297
return null;
298298
}
299299

300+
private HolidaySpecification? UprisingOfJune171953(int year)
301+
{
302+
if (year == 2028)
303+
{
304+
return new HolidaySpecification
305+
{
306+
Date = new DateTime(year, 5, 8),
307+
EnglishName = "75th anniversary of the uprising of June 17, 1953",
308+
LocalName = "75. Jahrestag des Aufstandes vom 17. Juni 1953",
309+
HolidayTypes = HolidayTypes.Public,
310+
SubdivisionCodes = ["DE-BE"]
311+
};
312+
}
313+
314+
return null;
315+
}
316+
300317
/// <inheritdoc/>
301318
public override IEnumerable<string> GetSources()
302319
{
303320
return
304321
[
305322
"https://de.wikipedia.org/wiki/Gesetzliche_Feiertage_in_Deutschland",
323+
"https://pardok.parlament-berlin.de/starweb/adis/citat/VT/19/gvbl/g24280460.pdf"
306324
];
307325
}
308326
}

src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs

+68-24
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
9494
Date = new DateTime(year, 6, 29),
9595
EnglishName = "Saints Peter and Paul",
9696
LocalName = "Peter und Paul",
97-
HolidayTypes = HolidayTypes.Public,
97+
HolidayTypes = HolidayTypes.Observance,
9898
SubdivisionCodes = ["CH-TI"]
9999
},
100100
new HolidaySpecification
@@ -105,22 +105,6 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
105105
HolidayTypes = HolidayTypes.Public
106106
},
107107
new HolidaySpecification
108-
{
109-
Date = new DateTime(year, 8, 15),
110-
EnglishName = "Assumption of the Virgin Mary",
111-
LocalName = "Maria Himmelfahrt",
112-
HolidayTypes = HolidayTypes.Public,
113-
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-BL", "CH-AI", "CH-GR", "CH-AG", "CH-TI", "CH-VS", "CH-JU"]
114-
},
115-
new HolidaySpecification
116-
{
117-
Date = new DateTime(year, 11, 1),
118-
EnglishName = "All Saints' Day",
119-
LocalName = "Allerheiligen",
120-
HolidayTypes = HolidayTypes.Public,
121-
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-GL", "CH-ZG", "CH-FR", "CH-SO", "CH-AI", "CH-SG", "CH-GR", "CH-AG", "CH-TI", "CH-VS", "CH-JU"]
122-
},
123-
new HolidaySpecification
124108
{
125109
Date = new DateTime(year, 12, 25),
126110
EnglishName = "Christmas Day",
@@ -151,6 +135,14 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
151135
HolidayTypes = HolidayTypes.Public,
152136
SubdivisionCodes = ["CH-VD"]
153137
},
138+
new HolidaySpecification
139+
{
140+
Date = new DateTime(year, 12, 31),
141+
EnglishName = "Restoration Day",
142+
LocalName = "Restauration de la République",
143+
HolidayTypes = HolidayTypes.Public,
144+
SubdivisionCodes = ["CH-GE"]
145+
},
154146
this._catholicProvider.GoodFriday("Karfreitag", year).SetSubdivisionCodes("CH-ZH", "CH-BE", "CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-GL", "CH-ZG", "CH-FR", "CH-SO", "CH-BS", "CH-BL", "CH-SH", "CH-AR", "CH-AI", "CH-SG", "CH-GR", "CH-AG", "CH-TG", "CH-VD", "CH-NE", "CH-GE", "CH-JU"),
155147
this._catholicProvider.AscensionDay("Auffahrt", year),
156148
};
@@ -161,6 +153,8 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
161153
holidaySpecifications.AddRangeIfNotNull(this.WhitMonday(year));
162154
holidaySpecifications.AddRangeIfNotNull(this.EasterMonday(year));
163155
holidaySpecifications.AddRangeIfNotNull(this.Epiphany(year));
156+
holidaySpecifications.AddRange(this.AssumptionOfTheVirginMary(year));
157+
holidaySpecifications.AddRange(this.AllSaintsDay(year));
164158
holidaySpecifications.AddIfNotNull(this.BerchtoldsDay(year));
165159
holidaySpecifications.AddRangeIfNotNull(this.SaintJosephsDay(year));
166160
holidaySpecifications.AddRangeIfNotNull(this.CorpusChristi(year));
@@ -194,12 +188,37 @@ private HolidaySpecification[] Epiphany(int year)
194188
];
195189
}
196190

191+
private HolidaySpecification[] AssumptionOfTheVirginMary(int year)
192+
{
193+
var englishName = "Assumption of the Virgin Mary";
194+
var localName = "Maria Himmelfahrt";
195+
196+
return
197+
[
198+
new HolidaySpecification
199+
{
200+
Date = new DateTime(year, 8, 15),
201+
EnglishName = englishName,
202+
LocalName = localName,
203+
HolidayTypes = HolidayTypes.Public,
204+
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-AG", "CH-TI", "CH-VS"]
205+
},
206+
new HolidaySpecification
207+
{
208+
Date = new DateTime(year, 8, 15),
209+
EnglishName = englishName,
210+
LocalName = localName,
211+
HolidayTypes = HolidayTypes.Observance,
212+
SubdivisionCodes = ["CH-AI", "CH-JU"]
213+
}
214+
];
215+
}
216+
197217
private HolidaySpecification BerchtoldsDay(int year)
198218
{
199219
var subdivisionCodes = new List<string>(["CH-BE", "CH-FR", "CH-SH", "CH-AG", "CH-TG", "CH-VD"]);
200220

201-
if (new DateTime(year, 1, 1).DayOfWeek == DayOfWeek.Sunday ||
202-
new DateTime(year, 12, 25).DayOfWeek == DayOfWeek.Sunday)
221+
if (new DateTime(year, 1, 1).DayOfWeek == DayOfWeek.Sunday)
203222
{
204223
subdivisionCodes.Add("CH-NE");
205224
}
@@ -240,6 +259,32 @@ private HolidaySpecification[] SaintJosephsDay(int year)
240259
];
241260
}
242261

262+
private HolidaySpecification[] AllSaintsDay(int year)
263+
{
264+
var englishName = "All Saints' Day";
265+
var localName = "Allerheiligen";
266+
267+
return
268+
[
269+
new HolidaySpecification
270+
{
271+
Date = new DateTime(year, 11, 1),
272+
EnglishName = englishName,
273+
LocalName = localName,
274+
HolidayTypes = HolidayTypes.Public,
275+
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-GL", "CH-ZG", "CH-FR", "CH-SO", "CH-SG", "CH-AG", "CH-TI", "CH-VS"]
276+
},
277+
new HolidaySpecification
278+
{
279+
Date = new DateTime(year, 11, 1),
280+
EnglishName = englishName,
281+
LocalName = localName,
282+
HolidayTypes = HolidayTypes.Observance,
283+
SubdivisionCodes = ["CH-AI", "CH-JU"]
284+
}
285+
];
286+
}
287+
243288
private HolidaySpecification[] EasterMonday(int year)
244289
{
245290
var localName = "Ostermontag";
@@ -295,15 +340,15 @@ private HolidaySpecification[] ImmaculateConception(int year)
295340
EnglishName = englishName,
296341
LocalName = localName,
297342
HolidayTypes = HolidayTypes.Public,
298-
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-AG", "CH-TI", "CH-VS"]
343+
SubdivisionCodes = ["CH-UR", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-AG", "CH-VS"]
299344
},
300345
new HolidaySpecification
301346
{
302347
Date = new DateTime(year, 12, 8),
303348
EnglishName = englishName,
304349
LocalName = localName,
305350
HolidayTypes = HolidayTypes.Observance,
306-
SubdivisionCodes = ["CH-AI", "CH-JU"]
351+
SubdivisionCodes = ["CH-AI", "CH-JU", "CH-LU", "CH-SZ", "CH-TI"]
307352
}
308353
];
309354
}
@@ -321,7 +366,7 @@ private HolidaySpecification[] LabourDay(int year)
321366
EnglishName = englishName,
322367
LocalName = localName,
323368
HolidayTypes = HolidayTypes.Public,
324-
SubdivisionCodes = ["CH-ZH", "CH-SO", "CH-BS", "CH-BL", "CH-SH", "CH-AG", "CH-NE", "CH-JU"]
369+
SubdivisionCodes = ["CH-ZH", "CH-SO", "CH-BS", "CH-BL", "CH-SH", "CH-NE", "CH-JU"]
325370
},
326371
new HolidaySpecification
327372
{
@@ -347,8 +392,7 @@ private HolidaySpecification[] StephensDay(int year)
347392
subdivisionCodes.AddRange(["CH-AR", "CH-AI"]);
348393
}
349394

350-
if (new DateTime(year, 1, 1).DayOfWeek == DayOfWeek.Sunday ||
351-
new DateTime(year, 12, 25).DayOfWeek == DayOfWeek.Sunday)
395+
if (new DateTime(year, 12, 25).DayOfWeek == DayOfWeek.Sunday)
352396
{
353397
subdivisionCodes.Add("CH-NE");
354398
}

0 commit comments

Comments
 (0)