Skip to content

Commit

Permalink
Ukraine - Add Statehood Day (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Aug 20, 2024
1 parent e24d841 commit 4f4ed6e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Nager.Date.Extensions;
using Nager.Date.Models;
using Nager.Date.ReligiousProviders;
using System;
Expand Down Expand Up @@ -94,9 +95,40 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
this._orthodoxProvider.Pentecost("Трійця", year)
};

holidaySpecifications.AddIfNotNull(this.StatehoodDay(year));

return holidaySpecifications;
}

private HolidaySpecification? StatehoodDay(int year)

Check warning on line 103 in src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 103 in src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 103 in src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 103 in src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 103 in src/Nager.Date/HolidayProviders/UkraineHolidayProvider.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
var englishName = "Statehood Day";
var localName = "Statehood Day";

if (year == 2022 || year == 2023)
{
return new HolidaySpecification
{
Date = new DateTime(year, 7, 28),
EnglishName = englishName,
LocalName = localName,
HolidayTypes = HolidayTypes.Public
};
}
else if (year >= 2024)
{
return new HolidaySpecification
{
Date = new DateTime(year, 7, 15),
EnglishName = englishName,
LocalName = localName,
HolidayTypes = HolidayTypes.Public
};
}

return null;
}

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

0 comments on commit 4f4ed6e

Please sign in to comment.