RelativeDate 1.0.21

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

// Install RelativeDate as a Cake Tool
#tool nuget:?package=RelativeDate&version=1.0.21

For a given year and month Relative Date will find the First, Second, Third, Fouth and Last interval, where the interval is Mon-Sat, Day, WeekDay or WeekendDay.

DateTime firstMonday = new RelativeDate(2018, 6).First(RelativeDate.Interval.Monday);
Assert.AreEqual(new DateTime(2018, 6, 4), firstMonday);
// first Monday in June 2018 is the 4th

DateTime secondThursday = new RelativeDate(2018, 6).Second(RelativeDate.Interval.Thursday);
Assert.AreEqual(new DateTime(2018, 6, 14), secondThursday);
// second Thursday in June 2018 is the 14th

DateTime thirdDay = new RelativeDate(2018, 6).Third(RelativeDate.Interval.Day);
Assert.AreEqual(new DateTime(2018, 6, 3), thirdDay);
// third day in June 2018 is the 3rd (Duh)

DateTime fourthWeekDay = new RelativeDate(2018, 6).Fourth(RelativeDate.Interval.WeekDay);
Assert.AreEqual(new DateTime(2018, 6, 6), fourthWeekDay);
// fourth week day in June 2018 is the 6th (It's a Wednesday btw)

DateTime lastWeekEndDay = new RelativeDate(2018, 6).Last(RelativeDate.Interval.WeekendDay);
Assert.AreEqual(new DateTime(2018, 6, 30), lastWeekEndDay);
// last weekend day in June 2018 is the 30th (Saturday)
Product Compatible and additional computed target framework versions.
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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.1 975 7/9/2018
1.1.0 891 7/5/2018
1.0.21 866 7/4/2018