<commit_before>﻿using Nager.Date.Contract;
using Nager.Date.Model;
using System;
using System.Collections.Generic;

namespace Nager.Date.PublicHolidays
{
    public class NetherlandsProvider : IPublicHolidayProvider
    {
        public IEnumerable<PublicHoliday> Get(DateTime easterSunday, int year)
        {
            //Netherlands
            var countryCode = CountryCode.NL;

            var items = new List<PublicHoliday>();
            items.Add(new PublicHoliday(1, 1, year, "Nieuwjaarsdag", "New Year's Day", countryCode, 1967));
            items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Goede Vrijdag", "Good Friday", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(1), " Pasen", "Easter Monday", countryCode, 1642));
            items.Add(new PublicHoliday(27, 4, year, "Koningsdag", "King's Day", countryCode));
            items.Add(new PublicHoliday(5, 5, year, "Bevrijdingsdag", "Liberation Day", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(39), "Hemelvaartsdag", "Ascension Day", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(50), "Pinksteren", "Whit Monday", countryCode));
            items.Add(new PublicHoliday(25, 12, year, "Weihnachten", "Christmas Day", countryCode));
            items.Add(new PublicHoliday(26, 12, year, "TweedeKerstdag", "Boxing Day", countryCode));

            return items;
        }
    }
}<commit_msg>improve netherlands provider<commit_after>﻿using Nager.Date.Contract;
using Nager.Date.Model;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Nager.Date.PublicHolidays
{
    public class NetherlandsProvider : IPublicHolidayProvider
    {
        public IEnumerable<PublicHoliday> Get(DateTime easterSunday, int year)
        {
            //Netherlands
            //https://en.wikipedia.org/wiki/Public_holidays_in_the_Netherlands
            var countryCode = CountryCode.NL;

            #region King's Day is Sunday fallback

            var kingsDay = 27;
            var kingsDate = new DateTime(year, 4, kingsDay);
            if (kingsDate.DayOfWeek == DayOfWeek.Sunday)
            {
                kingsDay = 26;
            }

            #endregion

            var items = new List<PublicHoliday>();
            items.Add(new PublicHoliday(1, 1, year, "Nieuwjaarsdag", "New Year's Day", countryCode, 1967));
            items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Goede Vrijdag", "Good Friday", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(1), " Pasen", "Easter Monday", countryCode, 1642));
            items.Add(new PublicHoliday(kingsDay, 4, year, "Koningsdag", "King's Day", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(39), "Hemelvaartsdag", "Ascension Day", countryCode));
            items.Add(new PublicHoliday(easterSunday.AddDays(50), "Pinksteren", "Whit Monday", countryCode));
            items.Add(new PublicHoliday(25, 12, year, "Eerste kerstdag", "Christmas Day", countryCode));
            items.Add(new PublicHoliday(26, 12, year, "Tweede kerstdag", "Christmas Day", countryCode));

            #region Liberation Day

            var liberationDay = new PublicHoliday(5, 5, year, "Bevrijdingsdag", "Liberation Day", countryCode, 1945);

            if (year >= 1990)
            {
                //in 1990, the day was declared to be a national holiday
                items.Add(liberationDay);
            }
            else if (year >= 1945)
            {
                if (year % 5 == 0)
                {
                    items.Add(liberationDay);
                }
            }

            #endregion

            return items.OrderBy(o => o.Date);
        }
    }
}
{'fraction_non_alphanumeric': 0.11603823685608072, 'fraction_numerical': 0.02097716409984068, 'mean_word_length': 2.5404135338345863, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '363784', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1083, 'n_words': 256}