Mastronardi.Utils.Date 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Mastronardi.Utils.Date --version 1.0.0                
NuGet\Install-Package Mastronardi.Utils.Date -Version 1.0.0                
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="Mastronardi.Utils.Date" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mastronardi.Utils.Date --version 1.0.0                
#r "nuget: Mastronardi.Utils.Date, 1.0.0"                
#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 Mastronardi.Utils.Date as a Cake Addin
#addin nuget:?package=Mastronardi.Utils.Date&version=1.0.0

// Install Mastronardi.Utils.Date as a Cake Tool
#tool nuget:?package=Mastronardi.Utils.Date&version=1.0.0                

Date Utilities

Easter

You can use our easter calendar for calculating easter for the next thousands of years. You can choose between the Catholic or Orthodox easter of select it automatically:

autoselect is by using:

AbstractEaster.CreateInstance(CultureInfo)

Depending on the CultureInfo it will create the correct instance. You can also create CatholicEaster or an OrthodoxEaster yourself.

Use the next methods to get the data for a specific year.

public abstract System.DateTime EasterSunday(int year);

public abstract System.DateTime GoodFriday(int year);

Daylight savings time

Calculating when DST starts and ends can be usefull, here you can find out how to get those dates:

Get them for this year

DST.GetTransitionTimes(out DateTime start, out DateTime end)

Get them for a specified year

DST.GetTransitionTimes(int year, out DateTime start, out DateTime end)

Get them for a specified year and timezone

DST.GetTransitionTimes(TimeZoneInfo timeZone, int year, out DateTime start, out DateTime end)

Holidays

If you want to add a number of working days to a date, it is usefull to not just do 5 + 2 for the weekend because there might be other holidays. So what do we do? well, with this function:

Holidays.AddWorkingDays(DateTime currentDate, int days)

it will add days, but also recognizes the other holidays (for Belgium for now)

To have a standard way to get new years day we have this method:

Holidays.GetNewyearsDate(int year)

To get the labour day (for belgium) use this method: Holidays.GetLabourDay(int year)

To get the Ascencion day for a specific year

Holidays.GetAscensionDay(int year)

To get Whit Sunday for a specific year

Holidays.GetWhitSunday(int year)

Get Whit Monday

Holidays.GetWhitMonday(int year)

Get Belgian national holiday

Holidays.GetBelgiumNationalHoliday(int year)

Get the Flemish Holiday (Vlaamse Feestdag)

Holidays.GetFlemishHoliday(int year)

Gets the assumption of the holy virgin. (Maria hemelvaart, Onze Lieve vrouwe hemelvaart)

Holidays.GetAssumptionOfTheHolyVirgin(int year)

Get the All Saints day

Holidays.GetAllSaintsDay(int year)

Get all souls day

Holidays.GetAllSoulsDay(int year)

Get Armistice Day

Holidays.GetArmisticeDay(int year)

Get Christmas Day

Holidays.GetChristmasDay(int year)

Get Christmas Monday

Holidays.GetChristmasMonday(int year)

Get Kings Day (The Netherlands)

Holidays.GetKingsDayTheNetherlands(int year)

Check whether its a public holiday in Belgium on a specific date:

Holidays.IsPublicHolidayInBelgium(DateTime date)

Check whether its a public holiday in The Netherlands on a specific date:

Holidays.IsPublicHolidayInTheNetherlands(DateTime date)

Helper method to check whether the specified date is in the weekend.

Holidays.IsWeekend(DateTime date)

Check whether the specified date is a working day in Belgium

Holidays.IsBelgianWorkingDay(DateTime date)

Check whether the specified date is a working day in The Netherlands

Holidays.IsDutchWorkingDay(DateTime date)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETStandard 2.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
1.1.4 435 10/10/2022
1.0.0 137 8/28/2023