Skip to content

Commit 01a65f3

Browse files
committed
Heard Island and McDonald Islands - Add HolidayProvider
1 parent 4762849 commit 01a65f3

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Nager.Date.Models;
2+
using System.Collections.Generic;
3+
4+
namespace Nager.Date.HolidayProviders
5+
{
6+
/// <summary>
7+
/// Heard Island and McDonald Islands HolidayProvider
8+
/// </summary>
9+
internal sealed class HeardIslandAndMcDonaldIslandsHolidayProvider : AbstractHolidayProvider
10+
{
11+
/// <summary>
12+
/// Heard Island and McDonald Islands HolidayProvider
13+
/// </summary>
14+
public HeardIslandAndMcDonaldIslandsHolidayProvider() : base(CountryCode.HM)
15+
{
16+
}
17+
18+
/// <inheritdoc/>
19+
protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(int year)
20+
{
21+
/*
22+
* Heard Island and McDonald Islands has no population therefore no official holidays.
23+
*/
24+
25+
var holidaySpecifications = new List<HolidaySpecification>();
26+
return holidaySpecifications;
27+
}
28+
29+
/// <inheritdoc/>
30+
public override IEnumerable<string> GetSources()
31+
{
32+
return
33+
[
34+
"https://en.wikipedia.org/wiki/Heard_Island_and_McDonald_Islands"
35+
];
36+
}
37+
}
38+
}

src/Nager.Date/HolidaySystem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public static class HolidaySystem
7373
{ CountryCode.GG, new Lazy<IHolidayProvider>(() => new GuernseyHolidayProvider(_catholicProvider))},
7474
{ CountryCode.GY, new Lazy<IHolidayProvider>(() => new GuyanaHolidayProvider(_catholicProvider))},
7575
{ CountryCode.HK, new Lazy<IHolidayProvider>(() => new HongKongHolidayProvider(_catholicProvider))},
76+
{ CountryCode.HM, new Lazy<IHolidayProvider>(() => new HeardIslandAndMcDonaldIslandsHolidayProvider())},
7677
{ CountryCode.HN, new Lazy<IHolidayProvider>(() => new HondurasHolidayProvider(_catholicProvider))},
7778
{ CountryCode.HR, new Lazy<IHolidayProvider>(() => new CroatiaHolidayProvider(_catholicProvider))},
7879
{ CountryCode.HT, new Lazy<IHolidayProvider>(() => new HaitiHolidayProvider(_catholicProvider))},

0 commit comments

Comments
 (0)