Trustsoft.HolidaysCalendar 2.0.0-rc1

This is a prerelease version of Trustsoft.HolidaysCalendar.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Trustsoft.HolidaysCalendar --version 2.0.0-rc1                
NuGet\Install-Package Trustsoft.HolidaysCalendar -Version 2.0.0-rc1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trustsoft.HolidaysCalendar" Version="2.0.0-rc1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Trustsoft.HolidaysCalendar --version 2.0.0-rc1                
#r "nuget: Trustsoft.HolidaysCalendar, 2.0.0-rc1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Trustsoft.HolidaysCalendar as a Cake Addin
#addin nuget:?package=Trustsoft.HolidaysCalendar&version=2.0.0-rc1&prerelease

// Install Trustsoft.HolidaysCalendar as a Cake Tool
#tool nuget:?package=Trustsoft.HolidaysCalendar&version=2.0.0-rc1&prerelease                

Logo Trustsoft.HolidaysCalendar

Work with holidays calendar with ease.

GitHub repository
GitHub repo size GitHub license GitHub commit activity

C# NET 6.0 - 9.0

NuGet Stable Version (Trustsoft.HolidaysCalendar) NuGet Latest Version (Trustsoft.HolidaysCalendar) NuGet Downloads

Library for working with the holiday calendar.

Out of the box, only Russian holiday calendar at http://xmlcalendar.ru is supported.

You can develop your own data providers, implementing IHolidaysDataProvider and IFallbackDataProvider contracts.

Getting Started

Install the NuGet package.

Usage:

Work with Russian holidays

//Creating calendar of Russian Holidays:
IHolidaysCalendar calendar = new RussianHolidaysCalendar(dataProvider, fallbackDataProvider);

// or you can control calendar creation
// create primary data provider
IHolidaysDataProvider dataProvider = new RussianHolidaysDataProvider();

// create fallback data provider
IFallbackDataProvider fallbackDataProvider = new RussianHolidaysFallbackDataProvider();

// create holiday calendar with data providers
IHolidaysCalendar calendar = new HolidaysCalendar(dataProvider, fallbackDataProvider);

// day to check
DateOnly date = DateOnly.ParseExact("2024.10.12", "yyyy.MM.dd");

// checking
bool isHoliday = calendar.IsHoliday(date);

bool isWeekend = calendar.IsWeekend(date);

bool isWeekend = calendar.IsWorkingDay(date);

bool IsWorWeek = calendar.IsWorkingWeekend(date);

DateOnly nextworkingDay = calendar.GetNextWorkingDay(date);

DateOnly adjustedWorkingDay = calendar.AdjustToWorkingDay(date);
Contracts:
  • IHolidaysCalendar - Describes a set of functions for working with holiday calendar.

  • IHolidaysDataProvider - Describes a holiday data provider.

  • IFallbackHolidaysDataProvider - Describes a fallback holiday data provider.

  • IHolidaysData - Describes a result of fetching data by data provider.

Classes:
  • HolidaysCalendar - IHolidayCalendar implementation.

  • RussianHolidaysCalendar - Russian holidays calendar.

  • RussianHolidaysDataProvider - Russian holidays data provider, used by RussianHolidaysCalendar.

  • RussianHolidaysFallbackDataProvider - Russian holidays fallback data provider, used by RussianHolidaysCalendar.

  • HolidaysDataFactory - Used to create object that implements IHolidaysData, useful when implementing IHolidaysDataProvider and IFallbackDataProvider contracts.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 36 2/1/2025
2.0.0-rc1 62 1/12/2025
1.0.0 106 11/25/2024
1.0.0-rc3 79 11/24/2024
1.0.0-rc2 79 11/24/2024
1.0.0-rc 82 11/18/2024

ChangeLog
           ---------
           2.0.0-rc1 Update contracts.
           2.0.0-rc1 Update XML Doc comments.
           2.0.0-rc1 Add RussianHolidaysCalendar class.
           1.0.0 First release version.
           1.0.0-rc3 Code refactoring and cleanup.
           1.0.0-rc3 Update project metadata.
           1.0.0-rc3 Update XML Doc comments.
           1.0.0-rc3 Fix codestyle.
           1.0.0-rc2 Add more target frameworks support, .NET 6.0-9.0.
           1.0.0-rc2 Fix working weekend reading in XmlCalendarDataProvider.
           1.0.0-rc2 Improve unit tests.
           1.0.0-rc1 First public Nuget package version.