Skip to content

Commit

Permalink
Switzerland - Fix Corpus Christi (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Sep 30, 2024
1 parent cdc6dbc commit 7b6a50e
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 @@ -177,14 +177,14 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
},
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.AscensionDay("Auffahrt", year),
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.WhitMonday(year));
holidaySpecifications.AddRangeIfNotNull(this.EasterMonday(year));
holidaySpecifications.AddRangeIfNotNull(this.Epiphany(year));
holidaySpecifications.AddIfNotNull(this.BerchtoldsDay(year));
holidaySpecifications.AddRangeIfNotNull(this.SaintJosephsDay(year));
holidaySpecifications.AddRangeIfNotNull(this.CorpusChristi(year));

return holidaySpecifications;
}
Expand Down Expand Up @@ -289,6 +289,20 @@ private HolidaySpecification[] WhitMonday(int year)
];
}

private HolidaySpecification[] CorpusChristi(int year)
{
var localName = "Fronleichnam";

var specificationPublic = this._catholicProvider.CorpusChristi(localName, year).SetSubdivisionCodes("CH-LU", "CH-UR", "CH-SZ", "CH-OW", "CH-NW", "CH-ZG", "CH-FR", "CH-SO", "CH-AI", "CH-AG", "CH-VS", "CH-JU");
var specificationObservance = this._catholicProvider.CorpusChristi(localName, year).SetSubdivisionCodes("CH-TI").SetHolidayTypes(HolidayTypes.Observance);

return
[
specificationPublic,
specificationObservance
];
}

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

0 comments on commit 7b6a50e

Please sign in to comment.