Skip to content
 
 

Repository files navigation

Icon

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

This 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

This 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

About

Allows you to write cleaner DateTime expressions and operation.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages