Skip to content

Commit

Permalink
Switzerland - Fix Immaculate Conception (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Sep 30, 2024
1 parent 7b6a50e commit e2133ca
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
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"]
},
new HolidaySpecification
{
Date = new DateTime(year, 12, 8),
EnglishName = "Immaculate Conception",
LocalName = "Mariä Empfängnis",
HolidayTypes = HolidayTypes.Public,
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-AI", "CH-GR", "CH-AG", "CH-TI", "CH-VS"]
},
new HolidaySpecification
{
Date = new DateTime(year, 12, 25),
EnglishName = "Christmas Day",
Expand Down Expand Up @@ -179,6 +171,7 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
this._catholicProvider.AscensionDay("Auffahrt", year),
};

holidaySpecifications.AddRangeIfNotNull(this.ImmaculateConception(year));
holidaySpecifications.AddRangeIfNotNull(this.WhitMonday(year));
holidaySpecifications.AddRangeIfNotNull(this.EasterMonday(year));
holidaySpecifications.AddRangeIfNotNull(this.Epiphany(year));
Expand Down Expand Up @@ -303,6 +296,32 @@ private HolidaySpecification[] CorpusChristi(int year)
];
}

private HolidaySpecification[] ImmaculateConception(int year)
{
var englishName = "Immaculate Conception";
var localName = "Mariä Empfängnis";

return
[
new HolidaySpecification
{
Date = new DateTime(year, 12, 8),
EnglishName = englishName,
LocalName = localName,
HolidayTypes = HolidayTypes.Public,
SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-AG", "CH-TI", "CH-VS"]
},
new HolidaySpecification
{
Date = new DateTime(year, 12, 8),
EnglishName = englishName,
LocalName = localName,
HolidayTypes = HolidayTypes.Observance,
SubdivisionCodes = ["CH-AI", "CH-JU"]
}
];
}

/// <inheritdoc/>
public override IEnumerable<string> GetSources()
{
Expand Down

0 comments on commit e2133ca

Please sign in to comment.