Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lightweight .NET library to calculate potential long weekends based on public holidays. Supports custom weekend definitions, bridge days, and provides easy-to-use APIs.

License

Notifications You must be signed in to change notification settings

nager/Nager.LongWeekend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

15 Commits

Repository files navigation

Nager.LongWeekend

Nager.LongWeekend is a lightweight, open-source .NET library that helps you calculate potential long weekends based on public holidays.
By providing a list of holidays and your defined weekend days, the library determines possible extended weekends β€” including those that can be created with optional bridge days.

✨ Features

  • Detects long weekends based on given holiday data.
  • Supports custom weekend definitions (not just Saturday/Sunday).
  • Considers bridge days to extend weekends.
  • Simple API with minimal dependencies.

πŸ“¦ Installation

The package is available on NuGet

PM> install-package Nager.LongWeekend

πŸš€ Usage Examples

var holidays = new HolidayRecord[]
{
	new HolidayRecord
	{
		Date = new DateOnly(2020, 01, 10),
		Name = "Holiday Friday"
	},
	new HolidayRecord
	{
		Date = new DateOnly(2020, 01, 13),
		Name = "Holiday Monday"
	}
};
var weekendDays = new DayOfWeek[] { DayOfWeek.Saturday, DayOfWeek.Sunday };
var availableBridgeDays = 1;
var longWeekendCalculator = new LongWeekendCalculator(holidays, weekendDays);
var longWeekends = longWeekendCalculator.Calculate(availableBridgeDays);

About

Lightweight .NET library to calculate potential long weekends based on public holidays. Supports custom weekend definitions, bridge days, and provides easy-to-use APIs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /