Skip to content

Commit

Permalink
Switzerland - Fix Easter Monday (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Sep 30, 2024
1 parent 3ebcf8f commit 3a9c9cc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
SubdivisionCodes = ["CH-VD"]
},
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"),
this._catholicProvider.EasterMonday("Ostermontag", 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-TI", "CH-VD", "CH-NE", "CH-GE", "CH-JU"),
this._catholicProvider.AscensionDay("Auffahrt", year),
this._catholicProvider.WhitMonday("Pfingstmontag", year).SetSubdivisionCodes("CH-ZH", "CH-BE", "CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-GL", "CH-ZG", "CH-FR", "CH-BS", "CH-BL", "CH-SH", "CH-AR", "CH-AI", "CH-SG", "CH-GR", "CH-TG", "CH-TI", "CH-VD", "CH-NE", "CH-GE", "CH-JU"),
this._catholicProvider.CorpusChristi("Fronleichnam", year).SetSubdivisionCodes("CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-AI", "CH-TI", "CH-VS", "CH-JU")
};

holidaySpecifications.AddRangeIfNotNull(this.EasterMonday(year));
holidaySpecifications.AddRangeIfNotNull(this.Epiphany(year));
holidaySpecifications.AddIfNotNull(this.BerchtoldsDay(year));
holidaySpecifications.AddRangeIfNotNull(this.SaintJosephsDay(year));
Expand Down Expand Up @@ -261,6 +261,20 @@ private HolidaySpecification[] SaintJosephsDay(int year)
];
}

private HolidaySpecification[] EasterMonday(int year)
{
var localName = "Ostermontag";

var specificationPublic = this._catholicProvider.EasterMonday(localName, year).SetSubdivisionCodes("CH-ZH", "CH-BE", "CH-GL", "CH-FR", "CH-BS", "CH-BL", "CH-SH", "CH-AR", "CH-AI", "CH-SG", "CH-GR", "CH-AG", "CH-TG", "CH-TI", "CH-VD", "CH-GE", "CH-JU");
var specificationObservance = this._catholicProvider.EasterMonday(localName, year).SetSubdivisionCodes("CH-UR", "CH-SZ", "CH-OW").SetHolidayTypes(HolidayTypes.Observance);

return
[
specificationPublic,
specificationObservance
];
}

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

0 comments on commit 3a9c9cc

Please sign in to comment.