Skip to content

Commit

Permalink
change src and doc folder, increase version, move to github ci/cd env…
Browse files Browse the repository at this point in the history
…iorment
  • Loading branch information
tinohager committed Sep 30, 2021
1 parent 00c8fd0 commit 3961ba1
Show file tree
Hide file tree
Showing 501 changed files with 119 additions and 46 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build, Test & Publish

on:
push:
paths:
- 'src/**'
- '.github/workflows/**'
branches: [ master ]
pull_request:
paths:
- 'src/**'
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration Release --no-restore
- name: Test
working-directory: ./src
run: |
dotnet test --configuration Release --no-restore --no-build --verbosity normal
- name: Build project and generate NuGet package
run: |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/Nager.Date/Nager.Date.csproj
- name: Push NuGet package
if: github.event_name != 'pull_request'
run: |
cd $GITHUB_WORKSPACE/out
dotnet nuget push *.nupkg --source https://www.nuget.org/api/v2/package --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols true
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### Fixed

## [Unreleased 1.29.3] - yyyy-mm-dd
## [1.30.0] - 2021-09-30

### Added
### Changed
### Deprecated
### Removed
- Add Bosnia and Herzegovina
- Add Singapore
### Fixed
- Fix Netherlands - Holiday Type of Good Friday
- Fix Chile - Set Battle of Arica only valid in CL-AP
- Fix Switzerland - Federal Day of Thanksgiving

## [1.29.2] - 2021-06-21

Expand Down
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

File renamed without changes
53 changes: 53 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Nager.Date

Nager.Date is a popular project to query holidays. We currently support over 100 countries.

## Country Support
The list of supported countries can be found [here](https://date.nager.at/Home/RegionStatistic)

## Examples

### Get all publicHolidays of a country and year
```cs
var publicHolidays = DateSystem.GetPublicHolidays(2021, "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
```cs
var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2021, 5, 31);
var publicHolidays = DateSystem.GetPublicHolidays(startDate, endDate, CountryCode.DE);
foreach (var publicHoliday in publicHolidays)
{
//publicHoliday...
}
```

### Check if a date is a public holiday
```cs
var date = new DateTime(2021, 1, 1);
if (DateSystem.IsPublicHoliday(date, CountryCode.DE))
{
Console.WriteLine("Is public holiday");
}
```

### Check if a date is a weekend day
```cs
var date = new DateTime(2021, 1, 1);
if (DateSystem.IsWeekend(date, CountryCode.DE))
{
Console.WriteLine("Is weekend");
}
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3961ba1

Please sign in to comment.