FluentDateTime
Partially inspired by Ruby DateTime Extensions
Allows you to write cleaner DateTime expressions and operation. For example your code can look like this:
- DateTime.Now - 1.Weeks() - 3.Days() + 14.Minutes();
- DateTime.Now + 5.Years();
- 3.Days().Ago();
- 2.Days().Since(DateTime.Now);
- DateTime.Now.NextDay();
- DateTime.Now.NextYear();
- DateTime.Now.PreviousYear();
- DateTime.Now.WeekAfter();
- DateTime.Now.Midnight();
- DateTime.Now.Noon();
- DateTime.Now.SetTime(11, 55, 0);
(See Unit Tests in the project for more details).
Nuget
There are two nuget packages
binary version
TheThis uses the standard approach to constructing a nuget package. It contains a dll which will be added as a reference to your project. You then deploy the binary with your project.
PM> Install-Package FluentDateTime
code only version
TheThis is a "code only" package that leverages the Content Convention of Nuget to inject code files into your project. Note that this is only compatible with C# projects.
The benefits of this approach are ease of debugging and less files to deploy
PM> Install-Package FluentDateTime-CodeOnly
Icon
Calendar from The Noun Project