Install
dotnet add package aweXpect.Chronology --version 0.2.0
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
aweXpect.Chronology
Extension methods for creating a TimeSpan or DateTime that reads more natural.
TimeSpan
Add the following extension methods on int and double that allow creating a TimeSpan:
.Milliseconds().Seconds().Minutes().Hours().Days()
// β Using traditional creation of TimeSpan
TimeSpan timeout = TimeSpan.FromSeconds(10);
TimeSpan timeout = 10.Seconds();
// β Using the extension methods from this library
It is also possible to combine multiple extension methods:
TimeSpan timeout = 1.Minutes(30.Seconds());
DateTime
Add extension methods on int for each month that allow creating a DateTime:
// β Using traditional creation of DateTime
DateTime time = new DateTime(2024, 12, 24);
DateTime time = 24.December(2024);
// β Using the extension methods from this library
It is also possible to specify a time:
DateTime time = 24.December(2024).At(18, 30);
It is also possible combine this with the TimeSpan extensions:
DateTime time = 3.Hours().Before(25.December(2024));
Changes from Previous Version
No structural changes between v0.1.0 and v0.2.0.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.