https://github.com/visualbean/danishholidays.net
A small library that provides a few methods including a list of danish holidays based on a given year.
https://github.com/visualbean/danishholidays.net
Last synced: 8 months ago
JSON representation
A small library that provides a few methods including a list of danish holidays based on a given year.
- Host: GitHub
- URL: https://github.com/visualbean/danishholidays.net
- Owner: VisualBean
- License: mit
- Created: 2015-05-29T07:21:47.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T11:39:26.000Z (about 9 years ago)
- Last Synced: 2025-08-21T10:53:23.363Z (10 months ago)
- Language: C#
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DanishHolidays.NET
A small library that provides a few helpful methods including a list of danish holidays based on a given year.
Calculations are based an algorithm created by Nasa to calculate Easter Sunday.
## Supported Platforms
* .NET4.5 (Desktop/Server)
* .NET4.0 (Desktop/Server)
* .NET3.5 (Desktop/Server)
* .NET3.0 (Desktop/Server)
* .NET2.0 (Desktop/Server)
* Windows 8 / 8.1 Store Apps
## Getting Started
DanishHolidays.NET is available on NuGet.
```
Install-Package DanishHolidays.NET
```
Or
you can [download](https://github.com/VisualBean/DanishHolidays.NET/archive/master.zip "download") this project as a zip and add src/NET{Version}/DanishHolidays.Net.dll as a reference to your project
## Usage
Get list of holidays for current year
```c#
var holidays = DanishHolidays.GetHolidays();
```
Get list of holidays for year ```Int```
```c#
var holidays = DanishHolidays.GetHolidays(1997);
```
Check if date is a holiday
```c#
var date = new DateTime(1997,12,24);
if(date.Isholiday())
{
//Its a holiday
}
```
Check if date is a holiday & Get holiday out
```c#
var date = new DateTime(1997,12,24);
var holiday = new Holiday();
if(date.Isholiday(out holiday))
{
Console.WriteLine(holiday.Name); //Returns "Juleaften"
}
```