Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FluentDateTime/FluentDateTime
Allows cleaner DateTime expressions and operations
https://github.com/FluentDateTime/FluentDateTime
Last synced: about 2 months ago
JSON representation
Allows cleaner DateTime expressions and operations
- Host: GitHub
- URL: https://github.com/FluentDateTime/FluentDateTime
- Owner: FluentDateTime
- License: mit
- Created: 2012-08-05T11:36:07.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T10:21:40.000Z (3 months ago)
- Last Synced: 2024-09-18T03:47:12.500Z (3 months ago)
- Language: C#
- Homepage:
- Size: 903 KB
- Stars: 688
- Watchers: 24
- Forks: 60
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
Awesome Lists containing this project
- awesome - FluentDateTime/FluentDateTime - Allows cleaner DateTime expressions and operations (C\#)
- awesome-dotnet-core - FluentDateTime - Allows you to write cleaner DateTime expressions and operation. Partially inspired by Ruby DateTime Extensions. (Frameworks, Libraries and Tools / Date and Time)
- fucking-awesome-dotnet-core - FluentDateTime - Allows you to write cleaner DateTime expressions and operation. Partially inspired by Ruby DateTime Extensions. (Frameworks, Libraries and Tools / Date and Time)
- awesome-dotnet-core - FluentDateTime - Allows you to write cleaner DateTime expressions and operation. Partially inspired by Ruby DateTime Extensions. (Frameworks, Libraries and Tools / Date and Time)
- awesome-dotnet-core - FluentDateTime - 允许您编写更清晰的DateTime表达式和操作。部分灵感来自Ruby DateTime Extensions。 (框架, 库和工具 / 日期和时间)
README
# FluentDateTime
[![Build status](https://ci.appveyor.com/api/projects/status/me89rbu5iv976k2q/branch/master?svg=true)](https://ci.appveyor.com/project/SimonCropp/fluentdatetime)
[![NuGet Status](https://img.shields.io/nuget/v/FluentDateTime.svg?label=FluentDateTime&cacheSeconds=86400)](https://www.nuget.org/packages/FluentDateTime/)Allows cleaner DateTime expressions and operations.
**See [Milestones](../../milestones?state=closed) for release notes.**
Inspired by Ruby DateTime Extensions
* [Extensions To Datetime](http://edgeguides.rubyonrails.org/active_support_core_extensions.html#extensions-to-datetime)
* [Extensions To Time](http://edgeguides.rubyonrails.org/active_support_core_extensions.html#extensions-to-time)## NuGet
https://nuget.org/packages/FluentDateTime/
## Usage
Here is some examples of use cases
```csharp
// DateTime operations
DateTime.Now - 1.Weeks() - 3.Days() + 14.Minutes()
DateTime.Now + 5.Years()// Relative DateTime evaluations
3.Days().Ago()
2.Days().Since(DateTime.Now)// Fluent DateTime estimations
DateTime.Now.NextDay()
DateTime.Now.NextYear()
DateTime.Now.PreviousYear()
DateTime.Now.WeekAfter()
DateTime.Now.Midnight()
DateTime.Now.Noon()// Current DateTime manipulation
DateTime.Now.SetTime(11, 55, 0)// DateTime expressions
2022.Mar(23) // (implicitly convertible to DateTime and DateTimeOffset)
2022.March(23).At(10, 26)
```_See [Unit Tests](https://github.com/FluentDateTime/FluentDateTime/tree/master/src/Tests) in the project for more details._
## Icon
[Calendar](http://thenounproject.com/noun/calendar/#icon-No404) from The Noun Project