All Projects → nager → Nager.date

nager / Nager.date

Licence: mit
🌎 Worldwide public holiday

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Nager.date

docker-sogo
Run sogo in a docker container.
Stars: ✭ 20 (-96.43%)
Mutual labels:  calendar, docker-container
Spekt8
Visualize your Kubernetes cluster in real time
Stars: ✭ 545 (-2.68%)
Mutual labels:  docker-container
Rultor
DevOps Team Assistant
Stars: ✭ 428 (-23.57%)
Mutual labels:  docker-container
Passwordpusher
🔐 PasswordPusher is an application to securely communicate passwords over the web. Passwords automatically expire after a certain number of views and/or time has passed.
Stars: ✭ 484 (-13.57%)
Mutual labels:  docker-container
Chinese Calendar
判断一天是不是法定节假日/法定工作日(查看节假日安排)
Stars: ✭ 441 (-21.25%)
Mutual labels:  calendar
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (-4.29%)
Mutual labels:  calendar
Docker It Scala
Docker integration testing kit with Scala
Stars: ✭ 427 (-23.75%)
Mutual labels:  docker-container
React Modern Calendar Datepicker
A modern, beautiful, customizable date picker for React
Stars: ✭ 555 (-0.89%)
Mutual labels:  calendar
Calendar Links
Generate add to calendar links for Google, iCal and other calendar systems
Stars: ✭ 544 (-2.86%)
Mutual labels:  calendar
Jupyterhub Deploy Docker
Reference deployment of JupyterHub with docker
Stars: ✭ 479 (-14.46%)
Mutual labels:  docker-container
Vue2 Calendar
vue 2.x calendar component
Stars: ✭ 477 (-14.82%)
Mutual labels:  calendar
Sppermissions
Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI.
Stars: ✭ 4,701 (+739.46%)
Mutual labels:  calendar
Ion2 Calendar
📅 A date picker components for ionic2 /ionic3 / ionic4
Stars: ✭ 537 (-4.11%)
Mutual labels:  calendar
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (-23.39%)
Mutual labels:  calendar
Dumb Init
A minimal init system for Linux containers
Stars: ✭ 5,372 (+859.29%)
Mutual labels:  docker-container
Chinese Calendar
📅 中国农历(阴历)与阳历(公历)转换与查询工具
Stars: ✭ 428 (-23.57%)
Mutual labels:  calendar
Tutor
The docker-based Open edX distribution designed for peace of mind
Stars: ✭ 470 (-16.07%)
Mutual labels:  docker-container
Runlike
Given an existing docker container, prints the command line necessary to run a copy of it.
Stars: ✭ 523 (-6.61%)
Mutual labels:  docker-container
Outlookcaldavsynchronizer
Sync Outlook with Google, SOGo, Nextcloud or any other CalDAV/CardDAV server
Stars: ✭ 560 (+0%)
Mutual labels:  calendar
Workalendar
Worldwide holidays and workdays computational toolkit.
Stars: ✭ 549 (-1.96%)
Mutual labels:  calendar

Build status Docker Image CI

📆 Nager.Date - Official Website

Nager.Date is a popular project to query holidays. We currently support over 100 countries. The project is based on .NET but provides a REST interface to retrieve the data. There are several ways to use Nager.Date, there is a public api, you can start your own docker container or you can use the nuget package.

Nager.Date is open source software and is completely free for commercial use. If you would like to support the project you can award a GitHub star ⭐️ or even better actively support us

Country Support

The list of supported countries can be found here.

How can I use it?

If you are use .net you can install the package via nuget for all other languages we have a docker image with a web api available.

nuget

The package is available via nuget

PM> install-package Nager.Date

web api

  • public use the public api date.nager.at
    • If you need more as 50 requests per day please use your own private api (docker).
  • private use your own api, docker container available on dockerhub
    • To run a local instance of the docker image run the following command
      docker run -e "EnableCors=true" -e "EnableIpRateLimiting=false" -e "EnableSwaggerMode=true" -p 80:80 nager/nager-date
      • EnableCors=true activate CORS support
      • EnableIpRateLimiting=false disable IpRateLimiting
      • EnableSwaggerMode=true activate Swagger UI as start page
      • -p 80:80 publish the port 80 from the docker to your host.

Generate a client for the web api

You can use swagger-codegen-cli to create a client for the api

docker run --rm -v C:\Temp:/local swaggerapi/swagger-codegen-cli-v3 generate -i https://date.nager.at/swagger/v1.0/swagger.json -l csharp-dotnet2 -o /local/out

Sponsor us

Your sponsorship helps us spend more time working on OpenSource related to Nager.Date, become a sponsor now. We started in 2014 and look forward to many more years...

Examples for .NET (nuget package)

Get all publicHolidays of a country and year

var publicHolidays = DateSystem.GetPublicHoliday(2017, "DE");
foreach (var publicHoliday in publicHolidays)
{
    //publicHoliday...
    //publicHoliday.Date -> The date
    //publicHoliday.LocalName -> The local name
    //publicHoliday.Name -> The english name
    //publicHoliday.Fixed -> Is this public holiday every year on the same date
    //publicHoliday.Global -> Is this public holiday in every county (federal state)
    //publicHoliday.Counties -> Is the public holiday only valid for a special county ISO-3166-2 - Federal states
    //publicHoliday.Type -> Public, Bank, School, Authorities, Optional, Observance
}

Get all publicHolidays for a date range

var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2018, 5, 31);
var publicHolidays = DateSystem.GetPublicHoliday(startDate, endDate, CountryCode.DE);
foreach (var publicHoliday in publicHolidays)
{
	//publicHoliday...
}

Check if a date is a public holiday

var date = new DateTime(2017, 1, 1);
if (DateSystem.IsPublicHoliday(date, CountryCode.DE))
{
    Console.WriteLine("Is public holiday");
}

Check if a date is a weekend day

var date = new DateTime(2017, 1, 1);
if (DateSystem.IsWeekend(date, CountryCode.DE))
{
    Console.WriteLine("Is weekend");
}

Areas of Application

  • telephone systems
  • carrier (land transport)
  • time recording

Blog Posts

Mark Seemann - Simple holidays

Alternative projects

Language Project Supported Countries (January 2019)
PHP yasumi 34
JavaScript date-holidays 142
Java jollyday 64
.NET Holiday 21
Python python-holidays 34
Python workalendar 59
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].