diff --git a/src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs b/src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs index 5e2b268e..e1c13871 100644 --- a/src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs +++ b/src/Nager.Date/HolidayProviders/SwitzerlandHolidayProvider.cs @@ -1,3 +1,4 @@ +using Nager.Date.Extensions; using Nager.Date.Helpers; using Nager.Date.Models; using Nager.Date.ReligiousProviders; @@ -97,14 +98,6 @@ protected override IEnumerable GetHolidaySpecifications(in SubdivisionCodes = ["CH-NE"] }, new HolidaySpecification - { - Date = new DateTime(year, 3, 19), - EnglishName = "Saint Joseph's Day", - LocalName = "Josefstag", - HolidayTypes = HolidayTypes.Public, - SubdivisionCodes = ["CH-LU", "CH-UR", "CH-SZ", "CH-NW", "CH-ZG", "CH-GR", "CH-TI", "CH-VS"] - }, - new HolidaySpecification { Date = new DateTime(year, 5, 1), EnglishName = "Labour Day", @@ -197,9 +190,37 @@ protected override IEnumerable GetHolidaySpecifications(in 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.SaintJosephsDay(year)); + return holidaySpecifications; } + private HolidaySpecification[] SaintJosephsDay(int year) + { + var englishName = "Saint Joseph's Day"; + var localName = "Josefstag"; + + return + [ + new HolidaySpecification + { + Date = new DateTime(year, 3, 19), + EnglishName = englishName, + LocalName = localName, + HolidayTypes = HolidayTypes.Public, + SubdivisionCodes = ["CH-SZ", "CH-VS"] + }, + new HolidaySpecification + { + Date = new DateTime(year, 3, 19), + EnglishName = englishName, + LocalName = localName, + HolidayTypes = HolidayTypes.Observance, + SubdivisionCodes = ["CH-LU", "CH-UR", "CH-NW", "CH-TI"] + } + ]; + } + /// public override IEnumerable GetSources() {