From d1c6814ec7453474e7bc22ef2c3879e1e42be646 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 08:42:00 -0400 Subject: [PATCH 1/9] Add net6.0 build target --- NuSpecs/Humanizer.Core.af.nuspec | 1 + NuSpecs/Humanizer.Core.ar.nuspec | 1 + NuSpecs/Humanizer.Core.az.nuspec | 1 + NuSpecs/Humanizer.Core.bg.nuspec | 1 + NuSpecs/Humanizer.Core.bn-BD.nuspec | 1 + NuSpecs/Humanizer.Core.cs.nuspec | 1 + NuSpecs/Humanizer.Core.da.nuspec | 1 + NuSpecs/Humanizer.Core.de.nuspec | 1 + NuSpecs/Humanizer.Core.el.nuspec | 1 + NuSpecs/Humanizer.Core.es.nuspec | 1 + NuSpecs/Humanizer.Core.fa.nuspec | 1 + NuSpecs/Humanizer.Core.fi-FI.nuspec | 1 + NuSpecs/Humanizer.Core.fil-PH.nuspec | 1 + NuSpecs/Humanizer.Core.fr-BE.nuspec | 1 + NuSpecs/Humanizer.Core.fr.nuspec | 1 + NuSpecs/Humanizer.Core.he.nuspec | 1 + NuSpecs/Humanizer.Core.hr.nuspec | 1 + NuSpecs/Humanizer.Core.hu.nuspec | 1 + NuSpecs/Humanizer.Core.hy.nuspec | 1 + NuSpecs/Humanizer.Core.id.nuspec | 1 + NuSpecs/Humanizer.Core.it.nuspec | 1 + NuSpecs/Humanizer.Core.ja.nuspec | 1 + NuSpecs/Humanizer.Core.ku.nuspec | 1 + NuSpecs/Humanizer.Core.lv.nuspec | 1 + NuSpecs/Humanizer.Core.nb-NO.nuspec | 1 + NuSpecs/Humanizer.Core.nb.nuspec | 1 + NuSpecs/Humanizer.Core.nl.nuspec | 1 + NuSpecs/Humanizer.Core.nuspec | 3 +++ NuSpecs/Humanizer.Core.pl.nuspec | 1 + NuSpecs/Humanizer.Core.pt.nuspec | 1 + NuSpecs/Humanizer.Core.ro.nuspec | 1 + NuSpecs/Humanizer.Core.ru.nuspec | 1 + NuSpecs/Humanizer.Core.sk.nuspec | 1 + NuSpecs/Humanizer.Core.sl.nuspec | 1 + NuSpecs/Humanizer.Core.sr-Latn.nuspec | 1 + NuSpecs/Humanizer.Core.sr.nuspec | 1 + NuSpecs/Humanizer.Core.sv.nuspec | 1 + NuSpecs/Humanizer.Core.ta.nuspec.unused | 1 + NuSpecs/Humanizer.Core.tr.nuspec | 1 + NuSpecs/Humanizer.Core.uk.nuspec | 1 + NuSpecs/Humanizer.Core.uz-Cyrl-UZ.nuspec | 1 + NuSpecs/Humanizer.Core.uz-Latn-UZ.nuspec | 1 + NuSpecs/Humanizer.Core.vi.nuspec | 1 + NuSpecs/Humanizer.Core.zh-CN.nuspec | 1 + NuSpecs/Humanizer.Core.zh-Hans.nuspec | 1 + NuSpecs/Humanizer.Core.zh-Hant.nuspec | 1 + azure-pipelines.yml | 9 ++++++++- src/Humanizer.Tests/Humanizer.Tests.csproj | 2 +- src/Humanizer/Humanizer.csproj | 2 +- version.json | 2 +- 50 files changed, 59 insertions(+), 4 deletions(-) diff --git a/NuSpecs/Humanizer.Core.af.nuspec b/NuSpecs/Humanizer.Core.af.nuspec index c481560be..a69e3a94a 100644 --- a/NuSpecs/Humanizer.Core.af.nuspec +++ b/NuSpecs/Humanizer.Core.af.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ar.nuspec b/NuSpecs/Humanizer.Core.ar.nuspec index 9ec78d7a8..3abb6425b 100644 --- a/NuSpecs/Humanizer.Core.ar.nuspec +++ b/NuSpecs/Humanizer.Core.ar.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.az.nuspec b/NuSpecs/Humanizer.Core.az.nuspec index dd5367439..d6c4a004b 100644 --- a/NuSpecs/Humanizer.Core.az.nuspec +++ b/NuSpecs/Humanizer.Core.az.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.bg.nuspec b/NuSpecs/Humanizer.Core.bg.nuspec index 39a8fd1d7..93924d00e 100644 --- a/NuSpecs/Humanizer.Core.bg.nuspec +++ b/NuSpecs/Humanizer.Core.bg.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.bn-BD.nuspec b/NuSpecs/Humanizer.Core.bn-BD.nuspec index 7e22c06b1..27585ce6d 100644 --- a/NuSpecs/Humanizer.Core.bn-BD.nuspec +++ b/NuSpecs/Humanizer.Core.bn-BD.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.cs.nuspec b/NuSpecs/Humanizer.Core.cs.nuspec index 661d7d19c..8a5fb02f8 100644 --- a/NuSpecs/Humanizer.Core.cs.nuspec +++ b/NuSpecs/Humanizer.Core.cs.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.da.nuspec b/NuSpecs/Humanizer.Core.da.nuspec index 8c888550b..4eeaf71da 100644 --- a/NuSpecs/Humanizer.Core.da.nuspec +++ b/NuSpecs/Humanizer.Core.da.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.de.nuspec b/NuSpecs/Humanizer.Core.de.nuspec index 2b2d2335d..3e248dff9 100644 --- a/NuSpecs/Humanizer.Core.de.nuspec +++ b/NuSpecs/Humanizer.Core.de.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.el.nuspec b/NuSpecs/Humanizer.Core.el.nuspec index d2579fac1..7bb205dff 100644 --- a/NuSpecs/Humanizer.Core.el.nuspec +++ b/NuSpecs/Humanizer.Core.el.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.es.nuspec b/NuSpecs/Humanizer.Core.es.nuspec index 358e1c7d1..cd050bdb4 100644 --- a/NuSpecs/Humanizer.Core.es.nuspec +++ b/NuSpecs/Humanizer.Core.es.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.fa.nuspec b/NuSpecs/Humanizer.Core.fa.nuspec index 0619e246e..3a8cc941a 100644 --- a/NuSpecs/Humanizer.Core.fa.nuspec +++ b/NuSpecs/Humanizer.Core.fa.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.fi-FI.nuspec b/NuSpecs/Humanizer.Core.fi-FI.nuspec index a4df01113..35796ee3a 100644 --- a/NuSpecs/Humanizer.Core.fi-FI.nuspec +++ b/NuSpecs/Humanizer.Core.fi-FI.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.fil-PH.nuspec b/NuSpecs/Humanizer.Core.fil-PH.nuspec index 5484dff84..0cd678b46 100644 --- a/NuSpecs/Humanizer.Core.fil-PH.nuspec +++ b/NuSpecs/Humanizer.Core.fil-PH.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.fr-BE.nuspec b/NuSpecs/Humanizer.Core.fr-BE.nuspec index e8e7019a1..6d2851e35 100644 --- a/NuSpecs/Humanizer.Core.fr-BE.nuspec +++ b/NuSpecs/Humanizer.Core.fr-BE.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.fr.nuspec b/NuSpecs/Humanizer.Core.fr.nuspec index 77e1bd74d..5d84bd3cc 100644 --- a/NuSpecs/Humanizer.Core.fr.nuspec +++ b/NuSpecs/Humanizer.Core.fr.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.he.nuspec b/NuSpecs/Humanizer.Core.he.nuspec index 174a418e9..4bd3936f6 100644 --- a/NuSpecs/Humanizer.Core.he.nuspec +++ b/NuSpecs/Humanizer.Core.he.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.hr.nuspec b/NuSpecs/Humanizer.Core.hr.nuspec index 612ed14c7..736a05a3a 100644 --- a/NuSpecs/Humanizer.Core.hr.nuspec +++ b/NuSpecs/Humanizer.Core.hr.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.hu.nuspec b/NuSpecs/Humanizer.Core.hu.nuspec index 69fa39c3d..3842c724b 100644 --- a/NuSpecs/Humanizer.Core.hu.nuspec +++ b/NuSpecs/Humanizer.Core.hu.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.hy.nuspec b/NuSpecs/Humanizer.Core.hy.nuspec index 0e3bdce76..ac8827dcd 100644 --- a/NuSpecs/Humanizer.Core.hy.nuspec +++ b/NuSpecs/Humanizer.Core.hy.nuspec @@ -20,6 +20,7 @@ + diff --git a/NuSpecs/Humanizer.Core.id.nuspec b/NuSpecs/Humanizer.Core.id.nuspec index b4ca6095c..c38c48cf9 100644 --- a/NuSpecs/Humanizer.Core.id.nuspec +++ b/NuSpecs/Humanizer.Core.id.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.it.nuspec b/NuSpecs/Humanizer.Core.it.nuspec index 6c23564c4..a6a1cc4bd 100644 --- a/NuSpecs/Humanizer.Core.it.nuspec +++ b/NuSpecs/Humanizer.Core.it.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ja.nuspec b/NuSpecs/Humanizer.Core.ja.nuspec index dc34f2ffd..6da99ed67 100644 --- a/NuSpecs/Humanizer.Core.ja.nuspec +++ b/NuSpecs/Humanizer.Core.ja.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ku.nuspec b/NuSpecs/Humanizer.Core.ku.nuspec index c0d067fd8..5c99b9f48 100644 --- a/NuSpecs/Humanizer.Core.ku.nuspec +++ b/NuSpecs/Humanizer.Core.ku.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.lv.nuspec b/NuSpecs/Humanizer.Core.lv.nuspec index 8c623d595..f2a5d1fae 100644 --- a/NuSpecs/Humanizer.Core.lv.nuspec +++ b/NuSpecs/Humanizer.Core.lv.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.nb-NO.nuspec b/NuSpecs/Humanizer.Core.nb-NO.nuspec index da799345a..038c6f03a 100644 --- a/NuSpecs/Humanizer.Core.nb-NO.nuspec +++ b/NuSpecs/Humanizer.Core.nb-NO.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.nb.nuspec b/NuSpecs/Humanizer.Core.nb.nuspec index cc13c8f32..f0cb4ac91 100644 --- a/NuSpecs/Humanizer.Core.nb.nuspec +++ b/NuSpecs/Humanizer.Core.nb.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.nl.nuspec b/NuSpecs/Humanizer.Core.nl.nuspec index 306a61316..8c495bc83 100644 --- a/NuSpecs/Humanizer.Core.nl.nuspec +++ b/NuSpecs/Humanizer.Core.nl.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.nuspec b/NuSpecs/Humanizer.Core.nuspec index f33b3cbeb..c6e3a0f11 100644 --- a/NuSpecs/Humanizer.Core.nuspec +++ b/NuSpecs/Humanizer.Core.nuspec @@ -18,6 +18,7 @@ + @@ -25,6 +26,8 @@ + + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.pl.nuspec b/NuSpecs/Humanizer.Core.pl.nuspec index 732334225..75593a0d5 100644 --- a/NuSpecs/Humanizer.Core.pl.nuspec +++ b/NuSpecs/Humanizer.Core.pl.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.pt.nuspec b/NuSpecs/Humanizer.Core.pt.nuspec index ca8cdafce..084ff7130 100644 --- a/NuSpecs/Humanizer.Core.pt.nuspec +++ b/NuSpecs/Humanizer.Core.pt.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ro.nuspec b/NuSpecs/Humanizer.Core.ro.nuspec index d0144af7f..4eb8746c4 100644 --- a/NuSpecs/Humanizer.Core.ro.nuspec +++ b/NuSpecs/Humanizer.Core.ro.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ru.nuspec b/NuSpecs/Humanizer.Core.ru.nuspec index b83ff5f5a..9c953e774 100644 --- a/NuSpecs/Humanizer.Core.ru.nuspec +++ b/NuSpecs/Humanizer.Core.ru.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.sk.nuspec b/NuSpecs/Humanizer.Core.sk.nuspec index 25d31509c..10ea8c0c2 100644 --- a/NuSpecs/Humanizer.Core.sk.nuspec +++ b/NuSpecs/Humanizer.Core.sk.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.sl.nuspec b/NuSpecs/Humanizer.Core.sl.nuspec index 49ab064ae..3ba1e1743 100644 --- a/NuSpecs/Humanizer.Core.sl.nuspec +++ b/NuSpecs/Humanizer.Core.sl.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.sr-Latn.nuspec b/NuSpecs/Humanizer.Core.sr-Latn.nuspec index 20029ef15..8312104db 100644 --- a/NuSpecs/Humanizer.Core.sr-Latn.nuspec +++ b/NuSpecs/Humanizer.Core.sr-Latn.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.sr.nuspec b/NuSpecs/Humanizer.Core.sr.nuspec index 9438bd468..464a316cf 100644 --- a/NuSpecs/Humanizer.Core.sr.nuspec +++ b/NuSpecs/Humanizer.Core.sr.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.sv.nuspec b/NuSpecs/Humanizer.Core.sv.nuspec index 4ef8d6c88..13215b74e 100644 --- a/NuSpecs/Humanizer.Core.sv.nuspec +++ b/NuSpecs/Humanizer.Core.sv.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.ta.nuspec.unused b/NuSpecs/Humanizer.Core.ta.nuspec.unused index f071d14bf..74c9d4348 100644 --- a/NuSpecs/Humanizer.Core.ta.nuspec.unused +++ b/NuSpecs/Humanizer.Core.ta.nuspec.unused @@ -20,6 +20,7 @@ + diff --git a/NuSpecs/Humanizer.Core.tr.nuspec b/NuSpecs/Humanizer.Core.tr.nuspec index 3a59c8512..c06ecea00 100644 --- a/NuSpecs/Humanizer.Core.tr.nuspec +++ b/NuSpecs/Humanizer.Core.tr.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.uk.nuspec b/NuSpecs/Humanizer.Core.uk.nuspec index b37731186..489d09eba 100644 --- a/NuSpecs/Humanizer.Core.uk.nuspec +++ b/NuSpecs/Humanizer.Core.uk.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.uz-Cyrl-UZ.nuspec b/NuSpecs/Humanizer.Core.uz-Cyrl-UZ.nuspec index a6d987efa..324e201a7 100644 --- a/NuSpecs/Humanizer.Core.uz-Cyrl-UZ.nuspec +++ b/NuSpecs/Humanizer.Core.uz-Cyrl-UZ.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.uz-Latn-UZ.nuspec b/NuSpecs/Humanizer.Core.uz-Latn-UZ.nuspec index 568d83e48..98668f0f5 100644 --- a/NuSpecs/Humanizer.Core.uz-Latn-UZ.nuspec +++ b/NuSpecs/Humanizer.Core.uz-Latn-UZ.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.vi.nuspec b/NuSpecs/Humanizer.Core.vi.nuspec index a98077d9f..1f7288b51 100644 --- a/NuSpecs/Humanizer.Core.vi.nuspec +++ b/NuSpecs/Humanizer.Core.vi.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.zh-CN.nuspec b/NuSpecs/Humanizer.Core.zh-CN.nuspec index fbc849261..d693eb77c 100644 --- a/NuSpecs/Humanizer.Core.zh-CN.nuspec +++ b/NuSpecs/Humanizer.Core.zh-CN.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.zh-Hans.nuspec b/NuSpecs/Humanizer.Core.zh-Hans.nuspec index eea8c4e0b..daf32b8af 100644 --- a/NuSpecs/Humanizer.Core.zh-Hans.nuspec +++ b/NuSpecs/Humanizer.Core.zh-Hans.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/NuSpecs/Humanizer.Core.zh-Hant.nuspec b/NuSpecs/Humanizer.Core.zh-Hant.nuspec index c4bde092f..0a219d40a 100644 --- a/NuSpecs/Humanizer.Core.zh-Hant.nuspec +++ b/NuSpecs/Humanizer.Core.zh-Hant.nuspec @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7988e550f..e2706a5de 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,9 +19,16 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .NET Core SDK 5.x' + displayName: 'Use .NET Core SDK 6.x' + inputs: + version: 6.x + includePreviewVersions: true + + - task: UseDotNet@2 + displayName: 'Use .NET Core Runtime 5.x' inputs: version: 5.x + packageType: runtime - task: UseDotNet@2 displayName: 'Use .NET Core Runtime 3.x' diff --git a/src/Humanizer.Tests/Humanizer.Tests.csproj b/src/Humanizer.Tests/Humanizer.Tests.csproj index 73497c26f..05d59f3ae 100644 --- a/src/Humanizer.Tests/Humanizer.Tests.csproj +++ b/src/Humanizer.Tests/Humanizer.Tests.csproj @@ -1,6 +1,6 @@  - net48;net5.0;netcoreapp3.1 + net6.0;net48;net5.0;netcoreapp3.1 false diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index 85ff1673c..900bf1a33 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -1,6 +1,6 @@  - netstandard1.0;netstandard2.0 + net6.0;netstandard1.0;netstandard2.0 Mehdi Khalili, Claire Novotny https://raw.githubusercontent.com/Humanizr/Humanizer/master/LICENSE https://github.com/Humanizr/Humanizer diff --git a/version.json b/version.json index 9e56de81a..af687c53b 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "2.10", + "version": "2.11", "publicReleaseRefSpec": [ "^refs/heads/main$", // we release out of main "^refs/heads/rel/v\\d+\\.\\d+" // we also release branches starting with rel/vN.N From cedd8e41641306f7f8e32abb6eb11fbf38e578c3 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 08:52:52 -0400 Subject: [PATCH 2/9] Update approvals test with latest API --- .../ApiApprover/DiffPlexReporter.cs | 2 +- ...provalTest.approve_public_api.approved.txt | 310 ++++++++++-------- .../ApiApprover/PublicApiApprovalTest.cs | 3 +- 3 files changed, 175 insertions(+), 140 deletions(-) diff --git a/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs b/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs index 1802255e3..736918ab7 100644 --- a/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs +++ b/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs @@ -1,4 +1,4 @@ -#if NET46 +#if NET48 // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index 791ed1eaa..f4db9199b 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -1,85 +1,5 @@ [assembly: System.Resources.NeutralResourcesLanguageAttribute("en")] -[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v1.0", FrameworkDisplayName="")] -namespace Humanizer.Bytes -{ - public class ByteRate - { - public ByteRate(Humanizer.Bytes.ByteSize size, System.TimeSpan interval) { } - public System.TimeSpan Interval { get; } - public Humanizer.Bytes.ByteSize Size { get; } - public string Humanize(Humanizer.Localisation.TimeUnit timeUnit = 1) { } - public string Humanize(string format, Humanizer.Localisation.TimeUnit timeUnit = 1) { } - } - public struct ByteSize : System.IComparable, System.IComparable, System.IEquatable - { - public const string Bit = "bit"; - public const long BitsInByte = 8; - public const string BitSymbol = "b"; - public const string Byte = "byte"; - public const long BytesInGigabyte = 1073741824; - public const long BytesInKilobyte = 1024; - public const long BytesInMegabyte = 1048576; - public const long BytesInTerabyte = 1099511627776; - public const string ByteSymbol = "B"; - public const string Gigabyte = "gigabyte"; - public const string GigabyteSymbol = "GB"; - public const string Kilobyte = "kilobyte"; - public const string KilobyteSymbol = "KB"; - public static readonly Humanizer.Bytes.ByteSize MaxValue; - public const string Megabyte = "megabyte"; - public const string MegabyteSymbol = "MB"; - public static readonly Humanizer.Bytes.ByteSize MinValue; - public const string Terabyte = "terabyte"; - public const string TerabyteSymbol = "TB"; - public ByteSize(double byteSize) { } - public long Bits { get; } - public double Bytes { get; } - public double Gigabytes { get; } - public double Kilobytes { get; } - public string LargestWholeNumberFullWord { get; } - public string LargestWholeNumberSymbol { get; } - public double LargestWholeNumberValue { get; } - public double Megabytes { get; } - public double Terabytes { get; } - public Humanizer.Bytes.ByteSize Add(Humanizer.Bytes.ByteSize bs) { } - public Humanizer.Bytes.ByteSize AddBits(long value) { } - public Humanizer.Bytes.ByteSize AddBytes(double value) { } - public Humanizer.Bytes.ByteSize AddGigabytes(double value) { } - public Humanizer.Bytes.ByteSize AddKilobytes(double value) { } - public Humanizer.Bytes.ByteSize AddMegabytes(double value) { } - public Humanizer.Bytes.ByteSize AddTerabytes(double value) { } - public int CompareTo(object obj) { } - public int CompareTo(Humanizer.Bytes.ByteSize other) { } - public override bool Equals(object value) { } - public bool Equals(Humanizer.Bytes.ByteSize value) { } - public static Humanizer.Bytes.ByteSize FromBits(long value) { } - public static Humanizer.Bytes.ByteSize FromBytes(double value) { } - public static Humanizer.Bytes.ByteSize FromGigabytes(double value) { } - public static Humanizer.Bytes.ByteSize FromKilobytes(double value) { } - public static Humanizer.Bytes.ByteSize FromMegabytes(double value) { } - public static Humanizer.Bytes.ByteSize FromTerabytes(double value) { } - public override int GetHashCode() { } - public static Humanizer.Bytes.ByteSize +(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static Humanizer.Bytes.ByteSize --(Humanizer.Bytes.ByteSize b) { } - public static bool ==(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static bool >(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static bool >=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static Humanizer.Bytes.ByteSize ++(Humanizer.Bytes.ByteSize b) { } - public static bool !=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static bool <(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static bool <=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static Humanizer.Bytes.ByteSize -(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } - public static Humanizer.Bytes.ByteSize -(Humanizer.Bytes.ByteSize b) { } - public static Humanizer.Bytes.ByteSize Parse(string s) { } - public Humanizer.Bytes.ByteSize Subtract(Humanizer.Bytes.ByteSize bs) { } - public string ToFullWords() { } - public override string ToString() { } - public string ToString(System.IFormatProvider provider) { } - public string ToString(string format) { } - public string ToString(string format, System.IFormatProvider provider) { } - public static bool TryParse(string s, out Humanizer.Bytes.ByteSize result) { } - } -} +[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName="")] namespace Humanizer { public class static ByteSizeExtensions @@ -151,8 +71,8 @@ namespace Humanizer } public class static DateHumanizeExtensions { - public static string Humanize(this System.DateTime input, bool utcDate = True, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } - public static string Humanize(this System.Nullable input, bool utcDate = True, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.DateTime input, System.Nullable utcDate = null, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.Nullable input, System.Nullable utcDate = null, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } public static string Humanize(this System.DateTimeOffset input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } public static string Humanize(this System.Nullable input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } } @@ -209,6 +129,18 @@ namespace Humanizer Abbreviated = 0, Full = 1, } + public interface ICulturedStringTransformer : Humanizer.IStringTransformer + { + string Transform(string input, System.Globalization.CultureInfo culture); + } + public interface IStringTransformer + { + string Transform(string input); + } + public interface ITruncator + { + string Truncate(string value, int length, string truncationString, Humanizer.TruncateFrom truncateFrom = 1); + } public class In { public In() { } @@ -416,18 +348,10 @@ namespace Humanizer public static string Kebaberize(this string input) { } public static string Pascalize(this string input) { } public static string Pluralize(this string word, bool inputIsKnownToBeSingular = True) { } - public static string Singularize(this string word, bool inputIsKnownToBePlural = True) { } + public static string Singularize(this string word, bool inputIsKnownToBePlural = True, bool skipSimpleWords = False) { } public static string Titleize(this string input) { } public static string Underscore(this string input) { } } - public interface IStringTransformer - { - string Transform(string input); - } - public interface ITruncator - { - string Truncate(string value, int length, string truncationString, Humanizer.TruncateFrom truncateFrom = 1); - } public enum LetterCasing { Title = 0, @@ -438,8 +362,20 @@ namespace Humanizer public class static MetricNumeralExtensions { public static double FromMetric(this string input) { } - public static string ToMetric(this int input, bool hasSpace = False, bool useSymbol = True, System.Nullable decimals = null) { } - public static string ToMetric(this double input, bool hasSpace = False, bool useSymbol = True, System.Nullable decimals = null) { } + [System.ObsoleteAttribute("Please use overload with MetricNumeralFormats")] + public static string ToMetric(this int input, bool hasSpace, bool useSymbol = True, System.Nullable decimals = null) { } + public static string ToMetric(this int input, System.Nullable formats = null, System.Nullable decimals = null) { } + [System.ObsoleteAttribute("Please use overload with MetricNumeralFormats")] + public static string ToMetric(this double input, bool hasSpace, bool useSymbol = True, System.Nullable decimals = null) { } + public static string ToMetric(this double input, System.Nullable formats = null, System.Nullable decimals = null) { } + } + [System.FlagsAttribute()] + public enum MetricNumeralFormats + { + UseLongScaleWord = 1, + UseName = 2, + UseShortScaleWord = 4, + WithSpace = 8, } public class NoMatchFoundException : System.Exception { @@ -537,8 +473,9 @@ namespace Humanizer public static string ToOrdinalWords(this int number, System.Globalization.CultureInfo culture = null) { } public static string ToOrdinalWords(this int number, Humanizer.GrammaticalGender gender, System.Globalization.CultureInfo culture = null) { } public static string ToWords(this int number, System.Globalization.CultureInfo culture = null) { } + public static string ToWords(this int number, bool addAnd, System.Globalization.CultureInfo culture = null) { } public static string ToWords(this int number, Humanizer.GrammaticalGender gender, System.Globalization.CultureInfo culture = null) { } - public static string ToWords(this long number, System.Globalization.CultureInfo culture = null) { } + public static string ToWords(this long number, System.Globalization.CultureInfo culture = null, bool addAnd = True) { } public static string ToWords(this long number, Humanizer.GrammaticalGender gender, System.Globalization.CultureInfo culture = null) { } } public class On @@ -1032,11 +969,12 @@ namespace Humanizer } public class static To { - public static Humanizer.IStringTransformer LowerCase { get; } - public static Humanizer.IStringTransformer SentenceCase { get; } - public static Humanizer.IStringTransformer TitleCase { get; } - public static Humanizer.IStringTransformer UpperCase { get; } + public static Humanizer.ICulturedStringTransformer LowerCase { get; } + public static Humanizer.ICulturedStringTransformer SentenceCase { get; } + public static Humanizer.ICulturedStringTransformer TitleCase { get; } + public static Humanizer.ICulturedStringTransformer UpperCase { get; } public static string Transform(this string input, params Humanizer.IStringTransformer[] transformers) { } + public static string Transform(this string input, System.Globalization.CultureInfo culture, params Humanizer.ICulturedStringTransformer[] transformers) { } } public class static ToQuantityExtensions { @@ -1070,6 +1008,90 @@ namespace Humanizer public static string Tupleize(this int input) { } } } +namespace Humanizer.Bytes +{ + public class ByteRate + { + public ByteRate(Humanizer.Bytes.ByteSize size, System.TimeSpan interval) { } + public System.TimeSpan Interval { get; } + public Humanizer.Bytes.ByteSize Size { get; } + public string Humanize(Humanizer.Localisation.TimeUnit timeUnit = 1) { } + public string Humanize(string format, Humanizer.Localisation.TimeUnit timeUnit = 1) { } + } + public struct ByteSize : System.IComparable, System.IComparable, System.IEquatable, System.IFormattable + { + public const string Bit = "bit"; + public const string BitSymbol = "b"; + public const long BitsInByte = 8; + public const string Byte = "byte"; + public const string ByteSymbol = "B"; + public const long BytesInGigabyte = 1073741824; + public const long BytesInKilobyte = 1024; + public const long BytesInMegabyte = 1048576; + public const long BytesInTerabyte = 1099511627776; + public const string Gigabyte = "gigabyte"; + public const string GigabyteSymbol = "GB"; + public const string Kilobyte = "kilobyte"; + public const string KilobyteSymbol = "KB"; + public static readonly Humanizer.Bytes.ByteSize MaxValue; + public const string Megabyte = "megabyte"; + public const string MegabyteSymbol = "MB"; + public static readonly Humanizer.Bytes.ByteSize MinValue; + public const string Terabyte = "terabyte"; + public const string TerabyteSymbol = "TB"; + public ByteSize(double byteSize) { } + public long Bits { get; } + public double Bytes { get; } + public double Gigabytes { get; } + public double Kilobytes { get; } + public string LargestWholeNumberFullWord { get; } + public string LargestWholeNumberSymbol { get; } + public double LargestWholeNumberValue { get; } + public double Megabytes { get; } + public double Terabytes { get; } + public Humanizer.Bytes.ByteSize Add(Humanizer.Bytes.ByteSize bs) { } + public Humanizer.Bytes.ByteSize AddBits(long value) { } + public Humanizer.Bytes.ByteSize AddBytes(double value) { } + public Humanizer.Bytes.ByteSize AddGigabytes(double value) { } + public Humanizer.Bytes.ByteSize AddKilobytes(double value) { } + public Humanizer.Bytes.ByteSize AddMegabytes(double value) { } + public Humanizer.Bytes.ByteSize AddTerabytes(double value) { } + public int CompareTo(object obj) { } + public int CompareTo(Humanizer.Bytes.ByteSize other) { } + public override bool Equals(object value) { } + public bool Equals(Humanizer.Bytes.ByteSize value) { } + public static Humanizer.Bytes.ByteSize FromBits(long value) { } + public static Humanizer.Bytes.ByteSize FromBytes(double value) { } + public static Humanizer.Bytes.ByteSize FromGigabytes(double value) { } + public static Humanizer.Bytes.ByteSize FromKilobytes(double value) { } + public static Humanizer.Bytes.ByteSize FromMegabytes(double value) { } + public static Humanizer.Bytes.ByteSize FromTerabytes(double value) { } + public override int GetHashCode() { } + public string GetLargestWholeNumberFullWord(System.IFormatProvider provider = null) { } + public string GetLargestWholeNumberSymbol(System.IFormatProvider provider = null) { } + public static Humanizer.Bytes.ByteSize Parse(string s) { } + public static Humanizer.Bytes.ByteSize Parse(string s, System.IFormatProvider formatProvider) { } + public Humanizer.Bytes.ByteSize Subtract(Humanizer.Bytes.ByteSize bs) { } + public string ToFullWords(string format = null, System.IFormatProvider provider = null) { } + public override string ToString() { } + public string ToString(System.IFormatProvider provider) { } + public string ToString(string format) { } + public string ToString(string format, System.IFormatProvider provider) { } + public static bool TryParse(string s, out Humanizer.Bytes.ByteSize result) { } + public static bool TryParse(string s, System.IFormatProvider formatProvider, out Humanizer.Bytes.ByteSize result) { } + public static Humanizer.Bytes.ByteSize +(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static Humanizer.Bytes.ByteSize --(Humanizer.Bytes.ByteSize b) { } + public static bool ==(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static bool >(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static bool >=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static Humanizer.Bytes.ByteSize ++(Humanizer.Bytes.ByteSize b) { } + public static bool !=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static bool <(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static bool <=(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static Humanizer.Bytes.ByteSize -(Humanizer.Bytes.ByteSize b1, Humanizer.Bytes.ByteSize b2) { } + public static Humanizer.Bytes.ByteSize -(Humanizer.Bytes.ByteSize b) { } + } +} namespace Humanizer.Configuration { public class static Configurator @@ -1138,7 +1160,7 @@ namespace Humanizer.Inflections public void AddSingular(string rule, string replacement) { } public void AddUncountable(string word) { } public string Pluralize(string word, bool inputIsKnownToBeSingular = True) { } - public string Singularize(string word, bool inputIsKnownToBePlural = True) { } + public string Singularize(string word, bool inputIsKnownToBePlural = True, bool skipSimpleWords = False) { } } } namespace Humanizer.Localisation.CollectionFormatters @@ -1153,6 +1175,52 @@ namespace Humanizer.Localisation.CollectionFormatters string Humanize(System.Collections.Generic.IEnumerable collection, System.Func objectFormatter, string separator); } } +namespace Humanizer.Localisation +{ + public enum DataUnit + { + Bit = 0, + Byte = 1, + Kilobyte = 2, + Megabyte = 3, + Gigabyte = 4, + Terabyte = 5, + } + public class ResourceKeys + { + public ResourceKeys() { } + public class static DateHumanize + { + public const string Never = "DateHumanize_Never"; + public const string Now = "DateHumanize_Now"; + public static string GetResourceKey(Humanizer.Localisation.TimeUnit timeUnit, Humanizer.Localisation.Tense timeUnitTense, int count = 1) { } + } + public class static TimeSpanHumanize + { + public static string GetResourceKey(Humanizer.Localisation.TimeUnit unit, int count = 1, bool toWords = False) { } + } + } + public class static Resources + { + public static string GetResource(string resourceKey, System.Globalization.CultureInfo culture = null) { } + } + public enum Tense + { + Future = 0, + Past = 1, + } + public enum TimeUnit + { + Millisecond = 0, + Second = 1, + Minute = 2, + Hour = 3, + Day = 4, + Week = 5, + Month = 6, + Year = 7, + } +} namespace Humanizer.Localisation.DateToOrdinalWords { public interface IDateToOrdinalWordConverter @@ -1166,6 +1234,7 @@ namespace Humanizer.Localisation.Formatters public class DefaultFormatter : Humanizer.Localisation.Formatters.IFormatter { public DefaultFormatter(string localeCode) { } + public virtual string DataUnitHumanize(Humanizer.Localisation.DataUnit dataUnit, double count, bool toSymbol = True) { } public virtual string DateHumanize(Humanizer.Localisation.TimeUnit timeUnit, Humanizer.Localisation.Tense timeUnitTense, int unit) { } public virtual string DateHumanize_Never() { } public virtual string DateHumanize_Now() { } @@ -1178,6 +1247,7 @@ namespace Humanizer.Localisation.Formatters } public interface IFormatter { + string DataUnitHumanize(Humanizer.Localisation.DataUnit dataUnit, double count, bool toSymbol = True); string DateHumanize(Humanizer.Localisation.TimeUnit timeUnit, Humanizer.Localisation.Tense timeUnitTense, int unit); string DateHumanize_Never(); string DateHumanize_Now(); @@ -1190,7 +1260,8 @@ namespace Humanizer.Localisation.NumberToWords public interface INumberToWordsConverter { string Convert(long number); - string Convert(long number, Humanizer.GrammaticalGender gender); + string Convert(long number, bool addAnd); + string Convert(long number, Humanizer.GrammaticalGender gender, bool addAnd = True); string ConvertToOrdinal(int number); string ConvertToOrdinal(int number, Humanizer.GrammaticalGender gender); } @@ -1202,41 +1273,4 @@ namespace Humanizer.Localisation.Ordinalizers string Convert(int number, string numberString); string Convert(int number, string numberString, Humanizer.GrammaticalGender gender); } -} -namespace Humanizer.Localisation -{ - public class ResourceKeys - { - public ResourceKeys() { } - public class static DateHumanize - { - public const string Never = "DateHumanize_Never"; - public const string Now = "DateHumanize_Now"; - public static string GetResourceKey(Humanizer.Localisation.TimeUnit timeUnit, Humanizer.Localisation.Tense timeUnitTense, int count = 1) { } - } - public class static TimeSpanHumanize - { - public static string GetResourceKey(Humanizer.Localisation.TimeUnit unit, int count = 1, bool toWords = False) { } - } - } - public class static Resources - { - public static string GetResource(string resourceKey, System.Globalization.CultureInfo culture = null) { } - } - public enum Tense - { - Future = 0, - Past = 1, - } - public enum TimeUnit - { - Millisecond = 0, - Second = 1, - Minute = 2, - Hour = 3, - Day = 4, - Week = 5, - Month = 6, - Year = 7, - } } \ No newline at end of file diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs index 9d97ae4f9..a9848db6d 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs @@ -1,4 +1,4 @@ -#if NET46 +#if NET48 using System; using System.Linq; using ApprovalTests; @@ -42,6 +42,7 @@ private static string Filter(string text) .Where(l => !l.StartsWith("[assembly: AssemblyFileVersion(")) .Where(l => !l.StartsWith("[assembly: AssemblyInformationalVersion(")) .Where(l => !l.StartsWith("[assembly: System.Reflection.AssemblyMetadataAttribute(\"CommitHash\"")) + .Where(l => !l.StartsWith("[assembly: System.Reflection.AssemblyMetadataAttribute(\"RepositoryUrl\"")) .Where(l => !string.IsNullOrWhiteSpace(l)) ); } From 8ca5a0172e1fea5130b01ef3ab17c8a355dbe85f Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 08:57:05 -0400 Subject: [PATCH 3/9] Update api approver to use net6.0 surface area to cover full set of api's --- src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs | 2 +- .../PublicApiApprovalTest.approve_public_api.approved.txt | 8 +++++++- src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs | 2 +- src/Humanizer.Tests/Humanizer.Tests.csproj | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs b/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs index 736918ab7..394b64e5c 100644 --- a/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs +++ b/src/Humanizer.Tests/ApiApprover/DiffPlexReporter.cs @@ -1,4 +1,4 @@ -#if NET48 +#if NET6_0_OR_GREATER // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index f4db9199b..ac609b2f9 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -1,5 +1,5 @@ [assembly: System.Resources.NeutralResourcesLanguageAttribute("en")] -[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName="")] +[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName="")] namespace Humanizer { public class static ByteSizeExtensions @@ -1040,14 +1040,20 @@ namespace Humanizer.Bytes public const string Terabyte = "terabyte"; public const string TerabyteSymbol = "TB"; public ByteSize(double byteSize) { } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public long Bits { get; } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public double Bytes { get; } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public double Gigabytes { get; } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public double Kilobytes { get; } public string LargestWholeNumberFullWord { get; } public string LargestWholeNumberSymbol { get; } public double LargestWholeNumberValue { get; } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public double Megabytes { get; } + [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public double Terabytes { get; } public Humanizer.Bytes.ByteSize Add(Humanizer.Bytes.ByteSize bs) { } public Humanizer.Bytes.ByteSize AddBits(long value) { } diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs index a9848db6d..9ffe4d7d4 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs @@ -1,4 +1,4 @@ -#if NET48 +#if NET6_0_OR_GREATER using System; using System.Linq; using ApprovalTests; diff --git a/src/Humanizer.Tests/Humanizer.Tests.csproj b/src/Humanizer.Tests/Humanizer.Tests.csproj index 05d59f3ae..b6fb394d5 100644 --- a/src/Humanizer.Tests/Humanizer.Tests.csproj +++ b/src/Humanizer.Tests/Humanizer.Tests.csproj @@ -16,6 +16,8 @@ + + From 2664e3e9b6ef08d7b37dfa59353cac0b8efef0fc Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 09:22:56 -0400 Subject: [PATCH 4/9] Add doc comments to fix warnings --- src/Humanizer/Localisation/DataUnit.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Humanizer/Localisation/DataUnit.cs b/src/Humanizer/Localisation/DataUnit.cs index c615ceecf..a2228903a 100644 --- a/src/Humanizer/Localisation/DataUnit.cs +++ b/src/Humanizer/Localisation/DataUnit.cs @@ -5,11 +5,34 @@ /// public enum DataUnit { + /// + /// Bit + /// Bit, + + /// + /// Byte + /// Byte, + + /// + /// Kilobyte + /// Kilobyte, + + /// + /// Megabyte + /// Megabyte, + + /// + /// Gigabyte + /// Gigabyte, - Terabyte, + + /// + /// Terrabyte + /// + Terabyte } } From 72f10c076e0a28a76108c9884eb1e1b42979ba87 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 09:23:59 -0400 Subject: [PATCH 5/9] fix case --- src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs index 9ffe4d7d4..c6d499cc9 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.cs @@ -25,7 +25,7 @@ public PublicApiApprovalTest(ITestOutputHelper output) [UseReporter(typeof(DiffPlexReporter))] #endif [IgnoreLineEndings(true)] - public void approve_public_api() + public void Approve_Public_Api() { var publicApi = Filter(ApiGenerator.GeneratePublicApi(typeof(StringHumanizeExtensions).Assembly)); From 5ac82012cf767b251db540214988789d5cf2f362 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 09:51:47 -0400 Subject: [PATCH 6/9] Extract core logic into impl methods --- .../DateTimeHumanizeAlgorithms.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs b/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs index 1b25eea6e..7c0e9960b 100644 --- a/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs +++ b/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Humanizer.Configuration; using Humanizer.Localisation; @@ -18,6 +18,11 @@ public static string PrecisionHumanize(DateTime input, DateTime comparisonBase, var ts = new TimeSpan(Math.Abs(comparisonBase.Ticks - input.Ticks)); var tense = input > comparisonBase ? Tense.Future : Tense.Past; + return PrecisionHumanize(ts, tense, precision, culture); + } + + private static string PrecisionHumanize(TimeSpan ts, Tense tense, double precision, CultureInfo culture) + { int seconds = ts.Seconds, minutes = ts.Minutes, hours = ts.Hours, days = ts.Days; int years = 0, months = 0; @@ -112,6 +117,15 @@ public static string DefaultHumanize(DateTime input, DateTime comparisonBase, Cu var tense = input > comparisonBase ? Tense.Future : Tense.Past; var ts = new TimeSpan(Math.Abs(comparisonBase.Ticks - input.Ticks)); + var sameMonth = comparisonBase.Date.AddMonths(tense == Tense.Future ? 1 : -1) == input.Date; + + var days = Math.Abs((input.Date - comparisonBase.Date).Days); + + return DefaultHumanize(ts, sameMonth, days, tense, culture); + } + + private static string DefaultHumanize(TimeSpan ts, bool sameMonth, int days, Tense tense, CultureInfo culture) + { var formatter = Configurator.GetFormatter(culture); if (ts.TotalMilliseconds < 500) @@ -145,8 +159,7 @@ public static string DefaultHumanize(DateTime input, DateTime comparisonBase, Cu } if (ts.TotalHours < 48) - { - var days = Math.Abs((input.Date - comparisonBase.Date).Days); + { return formatter.DateHumanize(TimeUnit.Day, tense, days); } @@ -157,7 +170,7 @@ public static string DefaultHumanize(DateTime input, DateTime comparisonBase, Cu if (ts.TotalDays >= 28 && ts.TotalDays < 30) { - if (comparisonBase.Date.AddMonths(tense == Tense.Future ? 1 : -1) == input.Date) + if (sameMonth) { return formatter.DateHumanize(TimeUnit.Month, tense, 1); } @@ -180,4 +193,4 @@ public static string DefaultHumanize(DateTime input, DateTime comparisonBase, Cu return formatter.DateHumanize(TimeUnit.Year, tense, years); } } -} \ No newline at end of file +} From 9c98ce8b6bd1ec835a507f79f469ff69d3ac3cbd Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 11:57:18 -0400 Subject: [PATCH 7/9] Add support for DateOnly/TimeOnly .Humanize() --- .../DateOnlyHumanizeTests.cs | 88 +++++++++++++++++++ .../Humanizer.Tests.Shared.projitems | 2 + .../TimeOnlyHumanizeTests.cs | 88 +++++++++++++++++++ ...provalTest.approve_public_api.approved.txt | 34 +++++++ src/Humanizer/Configuration/Configurator.cs | 24 ++++- src/Humanizer/DateHumanizeExtensions.cs | 71 +++++++++++++++ .../DateTimeHumanizeAlgorithms.cs | 53 +++++++++++ .../DefaultDateOnlyHumanizeStrategy.cs | 23 +++++ .../DefaultTimeOnlyHumanizeStrategy.cs | 23 +++++ .../IDateOnlyHumanizeStrategy.cs | 20 +++++ .../ITimeOnlyHumanizeStrategy.cs | 20 +++++ .../PrecisionDateOnlyHumanizeStrategy.cs | 34 +++++++ .../PrecisionTimeOnlyHumanizeStrategy.cs | 34 +++++++ src/Humanizer/Humanizer.csproj | 1 + 14 files changed, 514 insertions(+), 1 deletion(-) create mode 100644 src/Humanizer.Tests.Shared/DateOnlyHumanizeTests.cs create mode 100644 src/Humanizer.Tests.Shared/TimeOnlyHumanizeTests.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/DefaultDateOnlyHumanizeStrategy.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/DefaultTimeOnlyHumanizeStrategy.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/IDateOnlyHumanizeStrategy.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/ITimeOnlyHumanizeStrategy.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/PrecisionDateOnlyHumanizeStrategy.cs create mode 100644 src/Humanizer/DateTimeHumanizeStrategy/PrecisionTimeOnlyHumanizeStrategy.cs diff --git a/src/Humanizer.Tests.Shared/DateOnlyHumanizeTests.cs b/src/Humanizer.Tests.Shared/DateOnlyHumanizeTests.cs new file mode 100644 index 000000000..bb9c0771f --- /dev/null +++ b/src/Humanizer.Tests.Shared/DateOnlyHumanizeTests.cs @@ -0,0 +1,88 @@ +#if NET6_0_OR_GREATER + +using System; +using Humanizer.Configuration; +using Humanizer.DateTimeHumanizeStrategy; +using Xunit; + +namespace Humanizer.Tests +{ + [UseCulture("en-US")] + public class DateOnlyHumanizeTests + { + + [Fact] + public void DefaultStrategy_SameDate() + { + Configurator.DateOnlyHumanizeStrategy = new DefaultDateOnlyHumanizeStrategy(); + + var inputTime = new DateOnly(2015, 07, 05); + var baseTime = new DateOnly(2015, 07, 05); + + const string expectedResult = "now"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void DefaultStrategy_MonthApart() + { + Configurator.DateOnlyHumanizeStrategy = new DefaultDateOnlyHumanizeStrategy(); + + var inputTime = new DateOnly(2015, 08, 05); + var baseTime = new DateOnly(2015, 07, 05); + + const string expectedResult = "one month from now"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void DefaultStrategy_DaysAgo() + { + Configurator.DateOnlyHumanizeStrategy = new DefaultDateOnlyHumanizeStrategy(); + + var inputTime = new DateOnly(2015, 07, 02); + var baseTime = new DateOnly(2015, 07, 05); + + const string expectedResult = "3 days ago"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void PrecisionStrategy_NextDay() + { + Configurator.DateOnlyHumanizeStrategy = new PrecisionDateOnlyHumanizeStrategy(0.75); + + var inputTime = new DateOnly(2015, 07, 05); + var baseTime = new DateOnly(2015, 07, 04); + + const string expectedResult = "tomorrow"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + + [Fact] + public void Never() + { + DateOnly? never = null; + Assert.Equal("never", never.Humanize()); + } + + [Fact] + public void Nullable_ExpectSame() + { + DateOnly? never = new DateOnly(2015, 12, 7); + + Assert.Equal(never.Value.Humanize(), never.Humanize()); + } + } +} + +#endif diff --git a/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems b/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems index 07e7b2d0f..cb3ce2f4a 100644 --- a/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems +++ b/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems @@ -23,7 +23,9 @@ + + diff --git a/src/Humanizer.Tests.Shared/TimeOnlyHumanizeTests.cs b/src/Humanizer.Tests.Shared/TimeOnlyHumanizeTests.cs new file mode 100644 index 000000000..ee50ce3c0 --- /dev/null +++ b/src/Humanizer.Tests.Shared/TimeOnlyHumanizeTests.cs @@ -0,0 +1,88 @@ +#if NET6_0_OR_GREATER + +using System; +using Humanizer.Configuration; +using Humanizer.DateTimeHumanizeStrategy; +using Xunit; + +namespace Humanizer.Tests +{ + [UseCulture("en-US")] + public class TimeOnlyHumanizeTests + { + + [Fact] + public void DefaultStrategy_SameTime() + { + Configurator.TimeOnlyHumanizeStrategy = new DefaultTimeOnlyHumanizeStrategy(); + + var inputTime = new TimeOnly(13, 07, 05); + var baseTime = new TimeOnly(13, 07, 05); + + const string expectedResult = "now"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void DefaultStrategy_HoursApart() + { + Configurator.TimeOnlyHumanizeStrategy = new DefaultTimeOnlyHumanizeStrategy(); + + var inputTime = new TimeOnly(13, 08, 05); + var baseTime = new TimeOnly(1, 08, 05); + + const string expectedResult = "12 hours from now"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void DefaultStrategy_HoursAgo() + { + Configurator.TimeOnlyHumanizeStrategy = new DefaultTimeOnlyHumanizeStrategy(); + + var inputTime = new TimeOnly(13, 07, 02); + var baseTime = new TimeOnly(17, 07, 05); + + const string expectedResult = "4 hours ago"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + [Fact] + public void PrecisionStrategy_NextDay() + { + Configurator.TimeOnlyHumanizeStrategy = new PrecisionTimeOnlyHumanizeStrategy(0.75); + + var inputTime = new TimeOnly(18, 10, 49); + var baseTime = new TimeOnly(13, 07, 04); + + const string expectedResult = "5 hours from now"; + var actualResult = inputTime.Humanize(baseTime); + + Assert.Equal(expectedResult, actualResult); + } + + + [Fact] + public void Never() + { + TimeOnly? never = null; + Assert.Equal("never", never.Humanize()); + } + + [Fact] + public void Nullable_ExpectSame() + { + TimeOnly? never = new TimeOnly(23, 12, 7); + + Assert.Equal(never.Value.Humanize(), never.Humanize()); + } + } +} + +#endif diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index ac609b2f9..a48898df5 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -75,6 +75,10 @@ namespace Humanizer public static string Humanize(this System.Nullable input, System.Nullable utcDate = null, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } public static string Humanize(this System.DateTimeOffset input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } public static string Humanize(this System.Nullable input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.DateOnly input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.Nullable input, System.Nullable dateToCompareAgainst = null, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.TimeOnly input, System.Nullable timeToCompareAgainst = null, bool useUtc = True, System.Globalization.CultureInfo culture = null) { } + public static string Humanize(this System.Nullable input, System.Nullable timeToCompareAgainst = null, bool useUtc = True, System.Globalization.CultureInfo culture = null) { } } public class static DateToOrdinalWordsExtensions { @@ -1103,6 +1107,7 @@ namespace Humanizer.Configuration public class static Configurator { public static Humanizer.Configuration.LocaliserRegistry CollectionFormatters { get; } + public static Humanizer.DateTimeHumanizeStrategy.IDateOnlyHumanizeStrategy DateOnlyHumanizeStrategy { get; set; } public static Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy DateTimeHumanizeStrategy { get; set; } public static Humanizer.DateTimeHumanizeStrategy.IDateTimeOffsetHumanizeStrategy DateTimeOffsetHumanizeStrategy { get; set; } public static Humanizer.Configuration.LocaliserRegistry DateToOrdinalWordsConverters { get; } @@ -1110,6 +1115,7 @@ namespace Humanizer.Configuration public static Humanizer.Configuration.LocaliserRegistry Formatters { get; } public static Humanizer.Configuration.LocaliserRegistry NumberToWordsConverters { get; } public static Humanizer.Configuration.LocaliserRegistry Ordinalizers { get; } + public static Humanizer.DateTimeHumanizeStrategy.ITimeOnlyHumanizeStrategy TimeOnlyHumanizeStrategy { get; set; } } public class LocaliserRegistry where TLocaliser : class @@ -1124,6 +1130,11 @@ namespace Humanizer.Configuration } namespace Humanizer.DateTimeHumanizeStrategy { + public class DefaultDateOnlyHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.IDateOnlyHumanizeStrategy + { + public DefaultDateOnlyHumanizeStrategy() { } + public string Humanize(System.DateOnly input, System.DateOnly comparisonBase, System.Globalization.CultureInfo culture) { } + } public class DefaultDateTimeHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy { public DefaultDateTimeHumanizeStrategy() { } @@ -1134,6 +1145,15 @@ namespace Humanizer.DateTimeHumanizeStrategy public DefaultDateTimeOffsetHumanizeStrategy() { } public string Humanize(System.DateTimeOffset input, System.DateTimeOffset comparisonBase, System.Globalization.CultureInfo culture) { } } + public class DefaultTimeOnlyHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.ITimeOnlyHumanizeStrategy + { + public DefaultTimeOnlyHumanizeStrategy() { } + public string Humanize(System.TimeOnly input, System.TimeOnly comparisonBase, System.Globalization.CultureInfo culture) { } + } + public interface IDateOnlyHumanizeStrategy + { + string Humanize(System.DateOnly input, System.DateOnly comparisonBase, System.Globalization.CultureInfo culture); + } public interface IDateTimeHumanizeStrategy { string Humanize(System.DateTime input, System.DateTime comparisonBase, System.Globalization.CultureInfo culture); @@ -1142,6 +1162,15 @@ namespace Humanizer.DateTimeHumanizeStrategy { string Humanize(System.DateTimeOffset input, System.DateTimeOffset comparisonBase, System.Globalization.CultureInfo culture); } + public interface ITimeOnlyHumanizeStrategy + { + string Humanize(System.TimeOnly input, System.TimeOnly comparisonBase, System.Globalization.CultureInfo culture); + } + public class PrecisionDateOnlyHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.IDateOnlyHumanizeStrategy + { + public PrecisionDateOnlyHumanizeStrategy(double precision = 0.75) { } + public string Humanize(System.DateOnly input, System.DateOnly comparisonBase, System.Globalization.CultureInfo culture) { } + } public class PrecisionDateTimeHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy { public PrecisionDateTimeHumanizeStrategy(double precision = 0.75) { } @@ -1152,6 +1181,11 @@ namespace Humanizer.DateTimeHumanizeStrategy public PrecisionDateTimeOffsetHumanizeStrategy(double precision = 0.75) { } public string Humanize(System.DateTimeOffset input, System.DateTimeOffset comparisonBase, System.Globalization.CultureInfo culture) { } } + public class PrecisionTimeOnlyHumanizeStrategy : Humanizer.DateTimeHumanizeStrategy.ITimeOnlyHumanizeStrategy + { + public PrecisionTimeOnlyHumanizeStrategy(double precision = 0.75) { } + public string Humanize(System.TimeOnly input, System.TimeOnly comparisonBase, System.Globalization.CultureInfo culture) { } + } } namespace Humanizer.Inflections { diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index 15b56bb4a..0e52bddc6 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Reflection; using Humanizer.DateTimeHumanizeStrategy; @@ -129,6 +129,28 @@ public static IDateTimeOffsetHumanizeStrategy DateTimeOffsetHumanizeStrategy set { _dateTimeOffsetHumanizeStrategy = value; } } +#if NET6_0_OR_GREATER + private static IDateOnlyHumanizeStrategy _dateOnlyHumanizeStrategy = new DefaultDateOnlyHumanizeStrategy(); + /// + /// The strategy to be used for DateOnly.Humanize + /// + public static IDateOnlyHumanizeStrategy DateOnlyHumanizeStrategy + { + get { return _dateOnlyHumanizeStrategy; } + set { _dateOnlyHumanizeStrategy = value; } + } + + private static ITimeOnlyHumanizeStrategy _timeOnlyHumanizeStrategy = new DefaultTimeOnlyHumanizeStrategy(); + /// + /// The strategy to be used for TimeOnly.Humanize + /// + public static ITimeOnlyHumanizeStrategy TimeOnlyHumanizeStrategy + { + get { return _timeOnlyHumanizeStrategy; } + set { _timeOnlyHumanizeStrategy = value; } + } +#endif + private static readonly Func DefaultEnumDescriptionPropertyLocator = p => p.Name == "Description"; private static Func _enumDescriptionPropertyLocator = DefaultEnumDescriptionPropertyLocator; /// diff --git a/src/Humanizer/DateHumanizeExtensions.cs b/src/Humanizer/DateHumanizeExtensions.cs index 86c6493ac..025dd7c88 100644 --- a/src/Humanizer/DateHumanizeExtensions.cs +++ b/src/Humanizer/DateHumanizeExtensions.cs @@ -78,5 +78,76 @@ public static string Humanize(this DateTimeOffset? input, DateTimeOffset? dateTo return Configurator.GetFormatter(culture).DateHumanize_Never(); } } + +#if NET6_0_OR_GREATER + /// + /// Turns the current or provided date into a human readable sentence + /// + /// The date to be humanized + /// Date to compare the input against. If null, current date is used as base + /// Culture to use. If null, current thread's UI culture is used. + /// distance of time in words + public static string Humanize(this DateOnly input, DateOnly? dateToCompareAgainst = null, CultureInfo culture = null) + { + var comparisonBase = dateToCompareAgainst.HasValue ? dateToCompareAgainst.Value : DateOnly.FromDateTime(DateTime.UtcNow); + + return Configurator.DateOnlyHumanizeStrategy.Humanize(input, comparisonBase, culture); + } + + /// + /// Turns the current or provided date into a human readable sentence, overload for the nullable DateTime, returning 'never' in case null + /// + /// The date to be humanized + /// Date to compare the input against. If null, current date is used as base + /// Culture to use. If null, current thread's UI culture is used. + /// distance of time in words + public static string Humanize(this DateOnly? input, DateOnly? dateToCompareAgainst = null, CultureInfo culture = null) + { + if (input.HasValue) + { + return Humanize(input.Value, dateToCompareAgainst, culture); + } + else + { + return Configurator.GetFormatter(culture).DateHumanize_Never(); + } + } + + /// + /// Turns the current or provided time into a human readable sentence + /// + /// The date to be humanized + /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. + /// Date to compare the input against. If null, current date is used as base + /// Culture to use. If null, current thread's UI culture is used. + /// distance of time in words + public static string Humanize(this TimeOnly input, TimeOnly? timeToCompareAgainst = null, bool useUtc = true, CultureInfo culture = null) + { + var comparisonBase = timeToCompareAgainst.HasValue ? timeToCompareAgainst.Value : TimeOnly.FromDateTime(useUtc ? DateTime.UtcNow : DateTime.Now); + + return Configurator.TimeOnlyHumanizeStrategy.Humanize(input, comparisonBase, culture); + } + + /// + /// Turns the current or provided time into a human readable sentence, overload for the nullable TimeOnly, returning 'never' in case null + /// + /// The date to be humanized + /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. + /// Time to compare the input against. If null, current date is used as base + /// Culture to use. If null, current thread's UI culture is used. + /// distance of time in words + public static string Humanize(this TimeOnly? input, TimeOnly? timeToCompareAgainst = null, bool useUtc = true, CultureInfo culture = null) + { + if (input.HasValue) + { + return Humanize(input.Value, timeToCompareAgainst, useUtc, culture); + } + else + { + return Configurator.GetFormatter(culture).DateHumanize_Never(); + } + } + +#endif } } diff --git a/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs b/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs index 7c0e9960b..fb34cf7c7 100644 --- a/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs +++ b/src/Humanizer/DateTimeHumanizeStrategy/DateTimeHumanizeAlgorithms.cs @@ -21,6 +21,30 @@ public static string PrecisionHumanize(DateTime input, DateTime comparisonBase, return PrecisionHumanize(ts, tense, precision, culture); } +#if NET6_0_OR_GREATER + /// + /// Returns localized & humanized distance of time between two dates; given a specific precision. + /// + public static string PrecisionHumanize(DateOnly input, DateOnly comparisonBase, double precision, CultureInfo culture) + { + var diffDays = Math.Abs(comparisonBase.DayOfYear - input.DayOfYear); + var ts = new TimeSpan(diffDays, 0, 0, 0); + var tense = input > comparisonBase ? Tense.Future : Tense.Past; + + return PrecisionHumanize(ts, tense, precision, culture); + } + + /// + /// Returns localized & humanized distance of time between two times; given a specific precision. + /// + public static string PrecisionHumanize(TimeOnly input, TimeOnly comparisonBase, double precision, CultureInfo culture) + { + var ts = new TimeSpan(Math.Abs(comparisonBase.Ticks - input.Ticks)); + var tense = input > comparisonBase ? Tense.Future : Tense.Past; + + return PrecisionHumanize(ts, tense, precision, culture); + } +#endif private static string PrecisionHumanize(TimeSpan ts, Tense tense, double precision, CultureInfo culture) { int seconds = ts.Seconds, minutes = ts.Minutes, hours = ts.Hours, days = ts.Days; @@ -124,6 +148,35 @@ public static string DefaultHumanize(DateTime input, DateTime comparisonBase, Cu return DefaultHumanize(ts, sameMonth, days, tense, culture); } +#if NET6_0_OR_GREATER + /// + /// Calculates the distance of time in words between two provided dates + /// + public static string DefaultHumanize(DateOnly input, DateOnly comparisonBase, CultureInfo culture) + { + var tense = input > comparisonBase ? Tense.Future : Tense.Past; + var diffDays = Math.Abs(comparisonBase.DayOfYear - input.DayOfYear); + var ts = new TimeSpan(diffDays, 0, 0, 0); + + var sameMonth = comparisonBase.AddMonths(tense == Tense.Future ? 1 : -1) == input; + + var days = Math.Abs(input.DayOfYear - comparisonBase.DayOfYear); + + return DefaultHumanize(ts, sameMonth, days, tense, culture); + } + + /// + /// Calculates the distance of time in words between two provided times + /// + public static string DefaultHumanize(TimeOnly input, TimeOnly comparisonBase, CultureInfo culture) + { + var tense = input > comparisonBase ? Tense.Future : Tense.Past; + var ts = new TimeSpan(Math.Abs(comparisonBase.Ticks - input.Ticks)); + + return DefaultHumanize(ts, true, 0, tense, culture); + } +#endif + private static string DefaultHumanize(TimeSpan ts, bool sameMonth, int days, Tense tense, CultureInfo culture) { var formatter = Configurator.GetFormatter(culture); diff --git a/src/Humanizer/DateTimeHumanizeStrategy/DefaultDateOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/DefaultDateOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..02fe0a678 --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/DefaultDateOnlyHumanizeStrategy.cs @@ -0,0 +1,23 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// The default 'distance of time' -> words calculator. + /// + public class DefaultDateOnlyHumanizeStrategy : IDateOnlyHumanizeStrategy + { + /// + /// Calculates the distance of time in words between two provided dates + /// + public string Humanize(DateOnly input, DateOnly comparisonBase, CultureInfo culture) + { + return DateTimeHumanizeAlgorithms.DefaultHumanize(input, comparisonBase, culture); + } + } +} + +#endif diff --git a/src/Humanizer/DateTimeHumanizeStrategy/DefaultTimeOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/DefaultTimeOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..be8ebb492 --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/DefaultTimeOnlyHumanizeStrategy.cs @@ -0,0 +1,23 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// The default 'distance of time' -> words calculator. + /// + public class DefaultTimeOnlyHumanizeStrategy : ITimeOnlyHumanizeStrategy + { + /// + /// Calculates the distance of time in words between two provided times + /// + public string Humanize(TimeOnly input, TimeOnly comparisonBase, CultureInfo culture) + { + return DateTimeHumanizeAlgorithms.DefaultHumanize(input, comparisonBase, culture); + } + } +} + +#endif diff --git a/src/Humanizer/DateTimeHumanizeStrategy/IDateOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/IDateOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..dcb63677c --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/IDateOnlyHumanizeStrategy.cs @@ -0,0 +1,20 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// Implement this interface to create a new strategy for DateOnly.Humanize and hook it in the Configurator.DateOnlyHumanizeStrategy + /// + public interface IDateOnlyHumanizeStrategy + { + /// + /// Calculates the distance of time in words between two provided dates used for DateOnly.Humanize + /// + string Humanize(DateOnly input, DateOnly comparisonBase, CultureInfo culture); + } +} + +#endif diff --git a/src/Humanizer/DateTimeHumanizeStrategy/ITimeOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/ITimeOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..fcb3080f1 --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/ITimeOnlyHumanizeStrategy.cs @@ -0,0 +1,20 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// Implement this interface to create a new strategy for TimeOnly.Humanize and hook it in the Configurator.TimeOnlyHumanizeStrategy + /// + public interface ITimeOnlyHumanizeStrategy + { + /// + /// Calculates the distance of time in words between two provided dates used for TimeOnly.Humanize + /// + string Humanize(TimeOnly input, TimeOnly comparisonBase, CultureInfo culture); + } +} + +#endif diff --git a/src/Humanizer/DateTimeHumanizeStrategy/PrecisionDateOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/PrecisionDateOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..04f872b7d --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/PrecisionDateOnlyHumanizeStrategy.cs @@ -0,0 +1,34 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// Precision-based calculator for distance between two times + /// + public class PrecisionDateOnlyHumanizeStrategy : IDateOnlyHumanizeStrategy + { + private readonly double _precision; + + /// + /// Constructs a precision-based calculator for distance of time with default precision 0.75. + /// + /// precision of approximation, if not provided 0.75 will be used as a default precision. + public PrecisionDateOnlyHumanizeStrategy(double precision = .75) + { + _precision = precision; + } + + /// + /// Returns localized & humanized distance of time between two dates; given a specific precision. + /// + public string Humanize(DateOnly input, DateOnly comparisonBase, CultureInfo culture) + { + return DateTimeHumanizeAlgorithms.PrecisionHumanize(input, comparisonBase, _precision, culture); + } + } +} + +#endif diff --git a/src/Humanizer/DateTimeHumanizeStrategy/PrecisionTimeOnlyHumanizeStrategy.cs b/src/Humanizer/DateTimeHumanizeStrategy/PrecisionTimeOnlyHumanizeStrategy.cs new file mode 100644 index 000000000..aab205920 --- /dev/null +++ b/src/Humanizer/DateTimeHumanizeStrategy/PrecisionTimeOnlyHumanizeStrategy.cs @@ -0,0 +1,34 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; + +namespace Humanizer.DateTimeHumanizeStrategy +{ + /// + /// Precision-based calculator for distance between two times + /// + public class PrecisionTimeOnlyHumanizeStrategy : ITimeOnlyHumanizeStrategy + { + private readonly double _precision; + + /// + /// Constructs a precision-based calculator for distance of time with default precision 0.75. + /// + /// precision of approximation, if not provided 0.75 will be used as a default precision. + public PrecisionTimeOnlyHumanizeStrategy(double precision = .75) + { + _precision = precision; + } + + /// + /// Returns localized & humanized distance of time between two dates; given a specific precision. + /// + public string Humanize(TimeOnly input, TimeOnly comparisonBase, CultureInfo culture) + { + return DateTimeHumanizeAlgorithms.PrecisionHumanize(input, comparisonBase, _precision, culture); + } + } +} + +#endif diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index 900bf1a33..e7c110359 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -12,5 +12,6 @@ true Humanizer.snk embedded + preview \ No newline at end of file From f2de33dc730ad2debcb53692d55fba7ce24a0f03 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 12:50:01 -0400 Subject: [PATCH 8/9] Add DateOnly support for FluentDate --- .../FluentDate/InDateTests.cs | 44 + .../FluentDate/OnDateTests.cs | 30 + .../Humanizer.Tests.Shared.projitems | 2 + ...provalTest.approve_public_api.approved.txt | 609 ++ src/Humanizer/FluentDate/In.Months.cs | 196 +- src/Humanizer/FluentDate/In.SomeTimeFrom.cs | 2304 +++--- src/Humanizer/FluentDate/InDate.Months.cs | 204 + src/Humanizer/FluentDate/InDate.Months.tt | 44 + .../FluentDate/InDate.SomeTimeFrom.cs | 1024 +++ .../FluentDate/InDate.SomeTimeFrom.tt | 135 + src/Humanizer/FluentDate/InDate.cs | 19 + src/Humanizer/FluentDate/On.Days.cs | 6148 ++++++++--------- src/Humanizer/FluentDate/OnDate.Days.cs | 3111 +++++++++ src/Humanizer/FluentDate/OnDate.Days.tt | 59 + src/Humanizer/Humanizer.csproj | 31 +- 15 files changed, 9634 insertions(+), 4326 deletions(-) create mode 100644 src/Humanizer.Tests.Shared/FluentDate/InDateTests.cs create mode 100644 src/Humanizer.Tests.Shared/FluentDate/OnDateTests.cs create mode 100644 src/Humanizer/FluentDate/InDate.Months.cs create mode 100644 src/Humanizer/FluentDate/InDate.Months.tt create mode 100644 src/Humanizer/FluentDate/InDate.SomeTimeFrom.cs create mode 100644 src/Humanizer/FluentDate/InDate.SomeTimeFrom.tt create mode 100644 src/Humanizer/FluentDate/InDate.cs create mode 100644 src/Humanizer/FluentDate/OnDate.Days.cs create mode 100644 src/Humanizer/FluentDate/OnDate.Days.tt diff --git a/src/Humanizer.Tests.Shared/FluentDate/InDateTests.cs b/src/Humanizer.Tests.Shared/FluentDate/InDateTests.cs new file mode 100644 index 000000000..b4ac2a876 --- /dev/null +++ b/src/Humanizer.Tests.Shared/FluentDate/InDateTests.cs @@ -0,0 +1,44 @@ +#if NET6_0_OR_GREATER + +using System; +using Xunit; + +namespace Humanizer.Tests.FluentDate +{ + public class InDateTests + { + [Fact] + public void InJanuary() + { + Assert.Equal(new DateOnly(DateTime.Now.Year, 1, 1), InDate.January); + } + + [Fact] + public void InJanuaryOf2009() + { + Assert.Equal(new DateOnly(2009, 1, 1), InDate.JanuaryOf(2009)); + } + + [Fact] + public void InFebruary() + { + Assert.Equal(new DateOnly(DateTime.Now.Year, 2, 1), InDate.February); + } + + [Fact] + public void InTheYear() + { + Assert.Equal(new DateOnly(2009, 1, 1), InDate.TheYear(2009)); + } + + [Fact] + public void InFiveDays() + { + var baseDate = OnDate.January.The21st; + var date = InDate.Five.DaysFrom(baseDate); + Assert.Equal(baseDate.AddDays(5), date); + } + } +} +#endif + diff --git a/src/Humanizer.Tests.Shared/FluentDate/OnDateTests.cs b/src/Humanizer.Tests.Shared/FluentDate/OnDateTests.cs new file mode 100644 index 000000000..1c0cb4308 --- /dev/null +++ b/src/Humanizer.Tests.Shared/FluentDate/OnDateTests.cs @@ -0,0 +1,30 @@ +#if NET6_0_OR_GREATER + +using System; +using Xunit; + +namespace Humanizer.Tests.FluentDate +{ + public class OnDateTests + { + [Fact] + public void OnJanuaryThe23rd() + { + Assert.Equal(new DateOnly(DateTime.Now.Year, 1, 23), OnDate.January.The23rd); + } + + [Fact] + public void OnDecemberThe4th() + { + Assert.Equal(new DateOnly(DateTime.Now.Year, 12, 4), OnDate.December.The4th); + } + + [Fact] + public void OnFebruaryThe() + { + Assert.Equal(new DateOnly(DateTime.Now.Year, 2, 11), OnDate.February.The(11)); + } + } +} + +#endif diff --git a/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems b/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems index cb3ce2f4a..8518e6926 100644 --- a/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems +++ b/src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems @@ -23,6 +23,8 @@ + + diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index a48898df5..354294c69 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -344,6 +344,185 @@ namespace Humanizer public static System.DateTime YearsFrom(System.DateTime date) { } } } + public class InDate + { + public InDate() { } + public static System.DateOnly April { get; } + public static System.DateOnly August { get; } + public static System.DateOnly December { get; } + public static System.DateOnly February { get; } + public static System.DateOnly January { get; } + public static System.DateOnly July { get; } + public static System.DateOnly June { get; } + public static System.DateOnly March { get; } + public static System.DateOnly May { get; } + public static System.DateOnly November { get; } + public static System.DateOnly October { get; } + public static System.DateOnly September { get; } + public static System.DateOnly AprilOf(int year) { } + public static System.DateOnly AugustOf(int year) { } + public static System.DateOnly DecemberOf(int year) { } + public static System.DateOnly FebruaryOf(int year) { } + public static System.DateOnly JanuaryOf(int year) { } + public static System.DateOnly JulyOf(int year) { } + public static System.DateOnly JuneOf(int year) { } + public static System.DateOnly MarchOf(int year) { } + public static System.DateOnly MayOf(int year) { } + public static System.DateOnly NovemberOf(int year) { } + public static System.DateOnly OctoberOf(int year) { } + public static System.DateOnly SeptemberOf(int year) { } + public static System.DateOnly TheYear(int year) { } + public class static Eight + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Five + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Four + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Nine + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static One + { + public static System.DateOnly Day { get; } + public static System.DateOnly Month { get; } + public static System.DateOnly Week { get; } + public static System.DateOnly Year { get; } + public static System.DateOnly DayFrom(System.DateOnly date) { } + public static System.DateOnly DayFrom(System.DateTime date) { } + public static System.DateOnly MonthFrom(System.DateOnly date) { } + public static System.DateOnly MonthFrom(System.DateTime date) { } + public static System.DateOnly WeekFrom(System.DateOnly date) { } + public static System.DateOnly WeekFrom(System.DateTime date) { } + public static System.DateOnly YearFrom(System.DateOnly date) { } + public static System.DateOnly YearFrom(System.DateTime date) { } + } + public class static Seven + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Six + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Ten + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Three + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + public class static Two + { + public static System.DateOnly Days { get; } + public static System.DateOnly Months { get; } + public static System.DateOnly Weeks { get; } + public static System.DateOnly Years { get; } + public static System.DateOnly DaysFrom(System.DateOnly date) { } + public static System.DateOnly DaysFrom(System.DateTime date) { } + public static System.DateOnly MonthsFrom(System.DateOnly date) { } + public static System.DateOnly MonthsFrom(System.DateTime date) { } + public static System.DateOnly WeeksFrom(System.DateOnly date) { } + public static System.DateOnly WeeksFrom(System.DateTime date) { } + public static System.DateOnly YearsFrom(System.DateOnly date) { } + public static System.DateOnly YearsFrom(System.DateTime date) { } + } + } public class static InflectorExtensions { public static string Camelize(this string input) { } @@ -912,6 +1091,436 @@ namespace Humanizer public static System.DateTime The(int dayNumber) { } } } + public class OnDate + { + public OnDate() { } + public class April + { + public April() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class August + { + public August() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class December + { + public December() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class February + { + public February() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class January + { + public January() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class July + { + public July() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class June + { + public June() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class March + { + public March() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class May + { + public May() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class November + { + public November() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class October + { + public October() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The31st { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + public class September + { + public September() { } + public static System.DateOnly The10th { get; } + public static System.DateOnly The11th { get; } + public static System.DateOnly The12th { get; } + public static System.DateOnly The13th { get; } + public static System.DateOnly The14th { get; } + public static System.DateOnly The15th { get; } + public static System.DateOnly The16th { get; } + public static System.DateOnly The17th { get; } + public static System.DateOnly The18th { get; } + public static System.DateOnly The19th { get; } + public static System.DateOnly The1st { get; } + public static System.DateOnly The20th { get; } + public static System.DateOnly The21st { get; } + public static System.DateOnly The22nd { get; } + public static System.DateOnly The23rd { get; } + public static System.DateOnly The24th { get; } + public static System.DateOnly The25th { get; } + public static System.DateOnly The26th { get; } + public static System.DateOnly The27th { get; } + public static System.DateOnly The28th { get; } + public static System.DateOnly The29th { get; } + public static System.DateOnly The2nd { get; } + public static System.DateOnly The30th { get; } + public static System.DateOnly The3rd { get; } + public static System.DateOnly The4th { get; } + public static System.DateOnly The5th { get; } + public static System.DateOnly The6th { get; } + public static System.DateOnly The7th { get; } + public static System.DateOnly The8th { get; } + public static System.DateOnly The9th { get; } + public static System.DateOnly The(int dayNumber) { } + } + } public enum OnNoMatch { ThrowsException = 0, diff --git a/src/Humanizer/FluentDate/In.Months.cs b/src/Humanizer/FluentDate/In.Months.cs index 9ab7f9e96..3e8cf85db 100644 --- a/src/Humanizer/FluentDate/In.Months.cs +++ b/src/Humanizer/FluentDate/In.Months.cs @@ -1,201 +1,201 @@ - + using System; namespace Humanizer { public partial class In { - + /// /// Returns 1st of January of the current year /// - public static DateTime January - { - get { return new DateTime(DateTime.UtcNow.Year, 1, 1); } - } + public static DateTime January + { + get { return new DateTime(DateTime.UtcNow.Year, 1, 1); } + } /// /// Returns 1st of January of the year passed in /// public static DateTime JanuaryOf(int year) - { - return new DateTime(year, 1, 1); - } - + { + return new DateTime(year, 1, 1); + } + /// /// Returns 1st of February of the current year /// - public static DateTime February - { - get { return new DateTime(DateTime.UtcNow.Year, 2, 1); } - } + public static DateTime February + { + get { return new DateTime(DateTime.UtcNow.Year, 2, 1); } + } /// /// Returns 1st of February of the year passed in /// public static DateTime FebruaryOf(int year) - { - return new DateTime(year, 2, 1); - } - + { + return new DateTime(year, 2, 1); + } + /// /// Returns 1st of March of the current year /// - public static DateTime March - { - get { return new DateTime(DateTime.UtcNow.Year, 3, 1); } - } + public static DateTime March + { + get { return new DateTime(DateTime.UtcNow.Year, 3, 1); } + } /// /// Returns 1st of March of the year passed in /// public static DateTime MarchOf(int year) - { - return new DateTime(year, 3, 1); - } - + { + return new DateTime(year, 3, 1); + } + /// /// Returns 1st of April of the current year /// - public static DateTime April - { - get { return new DateTime(DateTime.UtcNow.Year, 4, 1); } - } + public static DateTime April + { + get { return new DateTime(DateTime.UtcNow.Year, 4, 1); } + } /// /// Returns 1st of April of the year passed in /// public static DateTime AprilOf(int year) - { - return new DateTime(year, 4, 1); - } - + { + return new DateTime(year, 4, 1); + } + /// /// Returns 1st of May of the current year /// - public static DateTime May - { - get { return new DateTime(DateTime.UtcNow.Year, 5, 1); } - } + public static DateTime May + { + get { return new DateTime(DateTime.UtcNow.Year, 5, 1); } + } /// /// Returns 1st of May of the year passed in /// public static DateTime MayOf(int year) - { - return new DateTime(year, 5, 1); - } - + { + return new DateTime(year, 5, 1); + } + /// /// Returns 1st of June of the current year /// - public static DateTime June - { - get { return new DateTime(DateTime.UtcNow.Year, 6, 1); } - } + public static DateTime June + { + get { return new DateTime(DateTime.UtcNow.Year, 6, 1); } + } /// /// Returns 1st of June of the year passed in /// public static DateTime JuneOf(int year) - { - return new DateTime(year, 6, 1); - } - + { + return new DateTime(year, 6, 1); + } + /// /// Returns 1st of July of the current year /// - public static DateTime July - { - get { return new DateTime(DateTime.UtcNow.Year, 7, 1); } - } + public static DateTime July + { + get { return new DateTime(DateTime.UtcNow.Year, 7, 1); } + } /// /// Returns 1st of July of the year passed in /// public static DateTime JulyOf(int year) - { - return new DateTime(year, 7, 1); - } - + { + return new DateTime(year, 7, 1); + } + /// /// Returns 1st of August of the current year /// - public static DateTime August - { - get { return new DateTime(DateTime.UtcNow.Year, 8, 1); } - } + public static DateTime August + { + get { return new DateTime(DateTime.UtcNow.Year, 8, 1); } + } /// /// Returns 1st of August of the year passed in /// public static DateTime AugustOf(int year) - { - return new DateTime(year, 8, 1); - } - + { + return new DateTime(year, 8, 1); + } + /// /// Returns 1st of September of the current year /// - public static DateTime September - { - get { return new DateTime(DateTime.UtcNow.Year, 9, 1); } - } + public static DateTime September + { + get { return new DateTime(DateTime.UtcNow.Year, 9, 1); } + } /// /// Returns 1st of September of the year passed in /// public static DateTime SeptemberOf(int year) - { - return new DateTime(year, 9, 1); - } - + { + return new DateTime(year, 9, 1); + } + /// /// Returns 1st of October of the current year /// - public static DateTime October - { - get { return new DateTime(DateTime.UtcNow.Year, 10, 1); } - } + public static DateTime October + { + get { return new DateTime(DateTime.UtcNow.Year, 10, 1); } + } /// /// Returns 1st of October of the year passed in /// public static DateTime OctoberOf(int year) - { - return new DateTime(year, 10, 1); - } - + { + return new DateTime(year, 10, 1); + } + /// /// Returns 1st of November of the current year /// - public static DateTime November - { - get { return new DateTime(DateTime.UtcNow.Year, 11, 1); } - } + public static DateTime November + { + get { return new DateTime(DateTime.UtcNow.Year, 11, 1); } + } /// /// Returns 1st of November of the year passed in /// public static DateTime NovemberOf(int year) - { - return new DateTime(year, 11, 1); - } - + { + return new DateTime(year, 11, 1); + } + /// /// Returns 1st of December of the current year /// - public static DateTime December - { - get { return new DateTime(DateTime.UtcNow.Year, 12, 1); } - } + public static DateTime December + { + get { return new DateTime(DateTime.UtcNow.Year, 12, 1); } + } /// /// Returns 1st of December of the year passed in /// public static DateTime DecemberOf(int year) - { - return new DateTime(year, 12, 1); - } - } + { + return new DateTime(year, 12, 1); + } + } } \ No newline at end of file diff --git a/src/Humanizer/FluentDate/In.SomeTimeFrom.cs b/src/Humanizer/FluentDate/In.SomeTimeFrom.cs index 8cf1979bf..cac1da132 100644 --- a/src/Humanizer/FluentDate/In.SomeTimeFrom.cs +++ b/src/Humanizer/FluentDate/In.SomeTimeFrom.cs @@ -1,4 +1,4 @@ - + using System; namespace Humanizer @@ -7,1175 +7,1175 @@ namespace Humanizer /// public partial class In { - + /// /// - public static class One - { - /// - /// 1 seconds from now - /// - public static DateTime Second - { - get { return DateTime.UtcNow.AddSeconds(1); } - } - - /// - /// 1 seconds from the provided date - /// - public static DateTime SecondFrom(DateTime date) - { - return date.AddSeconds(1); - } - - /// - /// 1 minutes from now - /// - public static DateTime Minute - { - get { return DateTime.UtcNow.AddMinutes(1); } - } - - /// - /// 1 minutes from the provided date - /// - public static DateTime MinuteFrom(DateTime date) - { - return date.AddMinutes(1); - } - - /// - /// 1 hours from now - /// - public static DateTime Hour - { - get { return DateTime.UtcNow.AddHours(1); } - } - - /// - /// 1 hours from the provided date - /// - public static DateTime HourFrom(DateTime date) - { - return date.AddHours(1); - } - - /// - /// 1 days from now - /// - public static DateTime Day - { - get { return DateTime.UtcNow.AddDays(1); } - } - - /// - /// 1 days from the provided date - /// - public static DateTime DayFrom(DateTime date) - { - return date.AddDays(1); - } - - /// - /// 1 weeks from now - /// - public static DateTime Week - { - get { return DateTime.UtcNow.AddDays(7); } - } - - /// - /// 1 weeks from the provided date - /// - public static DateTime WeekFrom(DateTime date) - { - return date.AddDays(7); - } - - /// - /// 1 months from now - /// - public static DateTime Month - { - get { return DateTime.UtcNow.AddMonths(1); } - } - - /// - /// 1 months from the provided date - /// - public static DateTime MonthFrom(DateTime date) - { - return date.AddMonths(1); - } - - /// - /// 1 years from now - /// - public static DateTime Year - { - get { return DateTime.UtcNow.AddYears(1); } - } - - /// - /// 1 years from the provided date - /// - public static DateTime YearFrom(DateTime date) - { - return date.AddYears(1); - } - } - + public static class One + { + /// + /// 1 seconds from now + /// + public static DateTime Second + { + get { return DateTime.UtcNow.AddSeconds(1); } + } + + /// + /// 1 seconds from the provided date + /// + public static DateTime SecondFrom(DateTime date) + { + return date.AddSeconds(1); + } + + /// + /// 1 minutes from now + /// + public static DateTime Minute + { + get { return DateTime.UtcNow.AddMinutes(1); } + } + + /// + /// 1 minutes from the provided date + /// + public static DateTime MinuteFrom(DateTime date) + { + return date.AddMinutes(1); + } + + /// + /// 1 hours from now + /// + public static DateTime Hour + { + get { return DateTime.UtcNow.AddHours(1); } + } + + /// + /// 1 hours from the provided date + /// + public static DateTime HourFrom(DateTime date) + { + return date.AddHours(1); + } + + /// + /// 1 days from now + /// + public static DateTime Day + { + get { return DateTime.UtcNow.AddDays(1); } + } + + /// + /// 1 days from the provided date + /// + public static DateTime DayFrom(DateTime date) + { + return date.AddDays(1); + } + + /// + /// 1 weeks from now + /// + public static DateTime Week + { + get { return DateTime.UtcNow.AddDays(7); } + } + + /// + /// 1 weeks from the provided date + /// + public static DateTime WeekFrom(DateTime date) + { + return date.AddDays(7); + } + + /// + /// 1 months from now + /// + public static DateTime Month + { + get { return DateTime.UtcNow.AddMonths(1); } + } + + /// + /// 1 months from the provided date + /// + public static DateTime MonthFrom(DateTime date) + { + return date.AddMonths(1); + } + + /// + /// 1 years from now + /// + public static DateTime Year + { + get { return DateTime.UtcNow.AddYears(1); } + } + + /// + /// 1 years from the provided date + /// + public static DateTime YearFrom(DateTime date) + { + return date.AddYears(1); + } + } + /// /// - public static class Two - { - /// - /// 2 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(2); } - } - - /// - /// 2 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(2); - } - - /// - /// 2 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(2); } - } - - /// - /// 2 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(2); - } - - /// - /// 2 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(2); } - } - - /// - /// 2 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(2); - } - - /// - /// 2 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(2); } - } - - /// - /// 2 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(2); - } - - /// - /// 2 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(14); } - } - - /// - /// 2 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(14); - } - - /// - /// 2 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(2); } - } - - /// - /// 2 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(2); - } - - /// - /// 2 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(2); } - } - - /// - /// 2 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(2); - } - } - + public static class Two + { + /// + /// 2 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(2); } + } + + /// + /// 2 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(2); + } + + /// + /// 2 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(2); } + } + + /// + /// 2 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(2); + } + + /// + /// 2 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(2); } + } + + /// + /// 2 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(2); + } + + /// + /// 2 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(2); } + } + + /// + /// 2 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(2); + } + + /// + /// 2 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(14); } + } + + /// + /// 2 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(14); + } + + /// + /// 2 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(2); } + } + + /// + /// 2 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(2); + } + + /// + /// 2 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(2); } + } + + /// + /// 2 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(2); + } + } + /// /// - public static class Three - { - /// - /// 3 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(3); } - } - - /// - /// 3 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(3); - } - - /// - /// 3 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(3); } - } - - /// - /// 3 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(3); - } - - /// - /// 3 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(3); } - } - - /// - /// 3 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(3); - } - - /// - /// 3 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(3); } - } - - /// - /// 3 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(3); - } - - /// - /// 3 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(21); } - } - - /// - /// 3 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(21); - } - - /// - /// 3 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(3); } - } - - /// - /// 3 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(3); - } - - /// - /// 3 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(3); } - } - - /// - /// 3 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(3); - } - } - + public static class Three + { + /// + /// 3 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(3); } + } + + /// + /// 3 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(3); + } + + /// + /// 3 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(3); } + } + + /// + /// 3 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(3); + } + + /// + /// 3 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(3); } + } + + /// + /// 3 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(3); + } + + /// + /// 3 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(3); } + } + + /// + /// 3 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(3); + } + + /// + /// 3 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(21); } + } + + /// + /// 3 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(21); + } + + /// + /// 3 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(3); } + } + + /// + /// 3 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(3); + } + + /// + /// 3 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(3); } + } + + /// + /// 3 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(3); + } + } + /// /// - public static class Four - { - /// - /// 4 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(4); } - } - - /// - /// 4 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(4); - } - - /// - /// 4 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(4); } - } - - /// - /// 4 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(4); - } - - /// - /// 4 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(4); } - } - - /// - /// 4 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(4); - } - - /// - /// 4 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(4); } - } - - /// - /// 4 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(4); - } - - /// - /// 4 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(28); } - } - - /// - /// 4 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(28); - } - - /// - /// 4 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(4); } - } - - /// - /// 4 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(4); - } - - /// - /// 4 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(4); } - } - - /// - /// 4 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(4); - } - } - + public static class Four + { + /// + /// 4 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(4); } + } + + /// + /// 4 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(4); + } + + /// + /// 4 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(4); } + } + + /// + /// 4 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(4); + } + + /// + /// 4 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(4); } + } + + /// + /// 4 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(4); + } + + /// + /// 4 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(4); } + } + + /// + /// 4 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(4); + } + + /// + /// 4 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(28); } + } + + /// + /// 4 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(28); + } + + /// + /// 4 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(4); } + } + + /// + /// 4 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(4); + } + + /// + /// 4 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(4); } + } + + /// + /// 4 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(4); + } + } + /// /// - public static class Five - { - /// - /// 5 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(5); } - } - - /// - /// 5 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(5); - } - - /// - /// 5 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(5); } - } - - /// - /// 5 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(5); - } - - /// - /// 5 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(5); } - } - - /// - /// 5 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(5); - } - - /// - /// 5 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(5); } - } - - /// - /// 5 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(5); - } - - /// - /// 5 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(35); } - } - - /// - /// 5 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(35); - } - - /// - /// 5 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(5); } - } - - /// - /// 5 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(5); - } - - /// - /// 5 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(5); } - } - - /// - /// 5 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(5); - } - } - + public static class Five + { + /// + /// 5 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(5); } + } + + /// + /// 5 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(5); + } + + /// + /// 5 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(5); } + } + + /// + /// 5 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(5); + } + + /// + /// 5 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(5); } + } + + /// + /// 5 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(5); + } + + /// + /// 5 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(5); } + } + + /// + /// 5 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(5); + } + + /// + /// 5 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(35); } + } + + /// + /// 5 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(35); + } + + /// + /// 5 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(5); } + } + + /// + /// 5 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(5); + } + + /// + /// 5 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(5); } + } + + /// + /// 5 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(5); + } + } + /// /// - public static class Six - { - /// - /// 6 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(6); } - } - - /// - /// 6 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(6); - } - - /// - /// 6 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(6); } - } - - /// - /// 6 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(6); - } - - /// - /// 6 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(6); } - } - - /// - /// 6 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(6); - } - - /// - /// 6 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(6); } - } - - /// - /// 6 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(6); - } - - /// - /// 6 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(42); } - } - - /// - /// 6 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(42); - } - - /// - /// 6 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(6); } - } - - /// - /// 6 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(6); - } - - /// - /// 6 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(6); } - } - - /// - /// 6 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(6); - } - } - + public static class Six + { + /// + /// 6 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(6); } + } + + /// + /// 6 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(6); + } + + /// + /// 6 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(6); } + } + + /// + /// 6 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(6); + } + + /// + /// 6 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(6); } + } + + /// + /// 6 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(6); + } + + /// + /// 6 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(6); } + } + + /// + /// 6 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(6); + } + + /// + /// 6 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(42); } + } + + /// + /// 6 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(42); + } + + /// + /// 6 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(6); } + } + + /// + /// 6 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(6); + } + + /// + /// 6 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(6); } + } + + /// + /// 6 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(6); + } + } + /// /// - public static class Seven - { - /// - /// 7 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(7); } - } - - /// - /// 7 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(7); - } - - /// - /// 7 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(7); } - } - - /// - /// 7 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(7); - } - - /// - /// 7 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(7); } - } - - /// - /// 7 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(7); - } - - /// - /// 7 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(7); } - } - - /// - /// 7 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(7); - } - - /// - /// 7 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(49); } - } - - /// - /// 7 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(49); - } - - /// - /// 7 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(7); } - } - - /// - /// 7 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(7); - } - - /// - /// 7 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(7); } - } - - /// - /// 7 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(7); - } - } - + public static class Seven + { + /// + /// 7 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(7); } + } + + /// + /// 7 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(7); + } + + /// + /// 7 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(7); } + } + + /// + /// 7 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(7); + } + + /// + /// 7 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(7); } + } + + /// + /// 7 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(7); + } + + /// + /// 7 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(7); } + } + + /// + /// 7 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(7); + } + + /// + /// 7 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(49); } + } + + /// + /// 7 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(49); + } + + /// + /// 7 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(7); } + } + + /// + /// 7 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(7); + } + + /// + /// 7 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(7); } + } + + /// + /// 7 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(7); + } + } + /// /// - public static class Eight - { - /// - /// 8 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(8); } - } - - /// - /// 8 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(8); - } - - /// - /// 8 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(8); } - } - - /// - /// 8 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(8); - } - - /// - /// 8 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(8); } - } - - /// - /// 8 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(8); - } - - /// - /// 8 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(8); } - } - - /// - /// 8 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(8); - } - - /// - /// 8 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(56); } - } - - /// - /// 8 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(56); - } - - /// - /// 8 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(8); } - } - - /// - /// 8 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(8); - } - - /// - /// 8 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(8); } - } - - /// - /// 8 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(8); - } - } - + public static class Eight + { + /// + /// 8 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(8); } + } + + /// + /// 8 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(8); + } + + /// + /// 8 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(8); } + } + + /// + /// 8 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(8); + } + + /// + /// 8 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(8); } + } + + /// + /// 8 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(8); + } + + /// + /// 8 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(8); } + } + + /// + /// 8 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(8); + } + + /// + /// 8 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(56); } + } + + /// + /// 8 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(56); + } + + /// + /// 8 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(8); } + } + + /// + /// 8 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(8); + } + + /// + /// 8 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(8); } + } + + /// + /// 8 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(8); + } + } + /// /// - public static class Nine - { - /// - /// 9 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(9); } - } - - /// - /// 9 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(9); - } - - /// - /// 9 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(9); } - } - - /// - /// 9 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(9); - } - - /// - /// 9 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(9); } - } - - /// - /// 9 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(9); - } - - /// - /// 9 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(9); } - } - - /// - /// 9 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(9); - } - - /// - /// 9 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(63); } - } - - /// - /// 9 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(63); - } - - /// - /// 9 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(9); } - } - - /// - /// 9 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(9); - } - - /// - /// 9 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(9); } - } - - /// - /// 9 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(9); - } - } - + public static class Nine + { + /// + /// 9 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(9); } + } + + /// + /// 9 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(9); + } + + /// + /// 9 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(9); } + } + + /// + /// 9 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(9); + } + + /// + /// 9 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(9); } + } + + /// + /// 9 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(9); + } + + /// + /// 9 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(9); } + } + + /// + /// 9 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(9); + } + + /// + /// 9 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(63); } + } + + /// + /// 9 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(63); + } + + /// + /// 9 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(9); } + } + + /// + /// 9 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(9); + } + + /// + /// 9 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(9); } + } + + /// + /// 9 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(9); + } + } + /// /// - public static class Ten - { - /// - /// 10 seconds from now - /// - public static DateTime Seconds - { - get { return DateTime.UtcNow.AddSeconds(10); } - } - - /// - /// 10 seconds from the provided date - /// - public static DateTime SecondsFrom(DateTime date) - { - return date.AddSeconds(10); - } - - /// - /// 10 minutes from now - /// - public static DateTime Minutes - { - get { return DateTime.UtcNow.AddMinutes(10); } - } - - /// - /// 10 minutes from the provided date - /// - public static DateTime MinutesFrom(DateTime date) - { - return date.AddMinutes(10); - } - - /// - /// 10 hours from now - /// - public static DateTime Hours - { - get { return DateTime.UtcNow.AddHours(10); } - } - - /// - /// 10 hours from the provided date - /// - public static DateTime HoursFrom(DateTime date) - { - return date.AddHours(10); - } - - /// - /// 10 days from now - /// - public static DateTime Days - { - get { return DateTime.UtcNow.AddDays(10); } - } - - /// - /// 10 days from the provided date - /// - public static DateTime DaysFrom(DateTime date) - { - return date.AddDays(10); - } - - /// - /// 10 weeks from now - /// - public static DateTime Weeks - { - get { return DateTime.UtcNow.AddDays(70); } - } - - /// - /// 10 weeks from the provided date - /// - public static DateTime WeeksFrom(DateTime date) - { - return date.AddDays(70); - } - - /// - /// 10 months from now - /// - public static DateTime Months - { - get { return DateTime.UtcNow.AddMonths(10); } - } - - /// - /// 10 months from the provided date - /// - public static DateTime MonthsFrom(DateTime date) - { - return date.AddMonths(10); - } - - /// - /// 10 years from now - /// - public static DateTime Years - { - get { return DateTime.UtcNow.AddYears(10); } - } - - /// - /// 10 years from the provided date - /// - public static DateTime YearsFrom(DateTime date) - { - return date.AddYears(10); - } - } - } + public static class Ten + { + /// + /// 10 seconds from now + /// + public static DateTime Seconds + { + get { return DateTime.UtcNow.AddSeconds(10); } + } + + /// + /// 10 seconds from the provided date + /// + public static DateTime SecondsFrom(DateTime date) + { + return date.AddSeconds(10); + } + + /// + /// 10 minutes from now + /// + public static DateTime Minutes + { + get { return DateTime.UtcNow.AddMinutes(10); } + } + + /// + /// 10 minutes from the provided date + /// + public static DateTime MinutesFrom(DateTime date) + { + return date.AddMinutes(10); + } + + /// + /// 10 hours from now + /// + public static DateTime Hours + { + get { return DateTime.UtcNow.AddHours(10); } + } + + /// + /// 10 hours from the provided date + /// + public static DateTime HoursFrom(DateTime date) + { + return date.AddHours(10); + } + + /// + /// 10 days from now + /// + public static DateTime Days + { + get { return DateTime.UtcNow.AddDays(10); } + } + + /// + /// 10 days from the provided date + /// + public static DateTime DaysFrom(DateTime date) + { + return date.AddDays(10); + } + + /// + /// 10 weeks from now + /// + public static DateTime Weeks + { + get { return DateTime.UtcNow.AddDays(70); } + } + + /// + /// 10 weeks from the provided date + /// + public static DateTime WeeksFrom(DateTime date) + { + return date.AddDays(70); + } + + /// + /// 10 months from now + /// + public static DateTime Months + { + get { return DateTime.UtcNow.AddMonths(10); } + } + + /// + /// 10 months from the provided date + /// + public static DateTime MonthsFrom(DateTime date) + { + return date.AddMonths(10); + } + + /// + /// 10 years from now + /// + public static DateTime Years + { + get { return DateTime.UtcNow.AddYears(10); } + } + + /// + /// 10 years from the provided date + /// + public static DateTime YearsFrom(DateTime date) + { + return date.AddYears(10); + } + } + } } \ No newline at end of file diff --git a/src/Humanizer/FluentDate/InDate.Months.cs b/src/Humanizer/FluentDate/InDate.Months.cs new file mode 100644 index 000000000..b245b240a --- /dev/null +++ b/src/Humanizer/FluentDate/InDate.Months.cs @@ -0,0 +1,204 @@ + +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer +{ + public partial class InDate + { + + /// + /// Returns 1st of January of the current year + /// + public static DateOnly January + { + get { return new DateOnly(DateTime.UtcNow.Year, 1, 1); } + } + + /// + /// Returns 1st of January of the year passed in + /// + public static DateOnly JanuaryOf(int year) + { + return new DateOnly(year, 1, 1); + } + + /// + /// Returns 1st of February of the current year + /// + public static DateOnly February + { + get { return new DateOnly(DateTime.UtcNow.Year, 2, 1); } + } + + /// + /// Returns 1st of February of the year passed in + /// + public static DateOnly FebruaryOf(int year) + { + return new DateOnly(year, 2, 1); + } + + /// + /// Returns 1st of March of the current year + /// + public static DateOnly March + { + get { return new DateOnly(DateTime.UtcNow.Year, 3, 1); } + } + + /// + /// Returns 1st of March of the year passed in + /// + public static DateOnly MarchOf(int year) + { + return new DateOnly(year, 3, 1); + } + + /// + /// Returns 1st of April of the current year + /// + public static DateOnly April + { + get { return new DateOnly(DateTime.UtcNow.Year, 4, 1); } + } + + /// + /// Returns 1st of April of the year passed in + /// + public static DateOnly AprilOf(int year) + { + return new DateOnly(year, 4, 1); + } + + /// + /// Returns 1st of May of the current year + /// + public static DateOnly May + { + get { return new DateOnly(DateTime.UtcNow.Year, 5, 1); } + } + + /// + /// Returns 1st of May of the year passed in + /// + public static DateOnly MayOf(int year) + { + return new DateOnly(year, 5, 1); + } + + /// + /// Returns 1st of June of the current year + /// + public static DateOnly June + { + get { return new DateOnly(DateTime.UtcNow.Year, 6, 1); } + } + + /// + /// Returns 1st of June of the year passed in + /// + public static DateOnly JuneOf(int year) + { + return new DateOnly(year, 6, 1); + } + + /// + /// Returns 1st of July of the current year + /// + public static DateOnly July + { + get { return new DateOnly(DateTime.UtcNow.Year, 7, 1); } + } + + /// + /// Returns 1st of July of the year passed in + /// + public static DateOnly JulyOf(int year) + { + return new DateOnly(year, 7, 1); + } + + /// + /// Returns 1st of August of the current year + /// + public static DateOnly August + { + get { return new DateOnly(DateTime.UtcNow.Year, 8, 1); } + } + + /// + /// Returns 1st of August of the year passed in + /// + public static DateOnly AugustOf(int year) + { + return new DateOnly(year, 8, 1); + } + + /// + /// Returns 1st of September of the current year + /// + public static DateOnly September + { + get { return new DateOnly(DateTime.UtcNow.Year, 9, 1); } + } + + /// + /// Returns 1st of September of the year passed in + /// + public static DateOnly SeptemberOf(int year) + { + return new DateOnly(year, 9, 1); + } + + /// + /// Returns 1st of October of the current year + /// + public static DateOnly October + { + get { return new DateOnly(DateTime.UtcNow.Year, 10, 1); } + } + + /// + /// Returns 1st of October of the year passed in + /// + public static DateOnly OctoberOf(int year) + { + return new DateOnly(year, 10, 1); + } + + /// + /// Returns 1st of November of the current year + /// + public static DateOnly November + { + get { return new DateOnly(DateTime.UtcNow.Year, 11, 1); } + } + + /// + /// Returns 1st of November of the year passed in + /// + public static DateOnly NovemberOf(int year) + { + return new DateOnly(year, 11, 1); + } + + /// + /// Returns 1st of December of the current year + /// + public static DateOnly December + { + get { return new DateOnly(DateTime.UtcNow.Year, 12, 1); } + } + + /// + /// Returns 1st of December of the year passed in + /// + public static DateOnly DecemberOf(int year) + { + return new DateOnly(year, 12, 1); + } + } +} +#endif \ No newline at end of file diff --git a/src/Humanizer/FluentDate/InDate.Months.tt b/src/Humanizer/FluentDate/InDate.Months.tt new file mode 100644 index 000000000..95365a7ca --- /dev/null +++ b/src/Humanizer/FluentDate/InDate.Months.tt @@ -0,0 +1,44 @@ +<#@ template debug="true" hostSpecific="true" #> +<#@ output extension=".cs" #> +<#@ Assembly Name="System.Core" #> +<#@ Assembly Name="System.Windows.Forms" #> +<#@ import namespace="System" #> +<#@ import namespace="System.IO" #> +<#@ import namespace="System.Diagnostics" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Collections" #> +<#@ import namespace="System.Collections.Generic" #> +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer +{ + public partial class InDate + { + <#var now = DateTime.Now; + for (int i = 0; i < 12; i++){ + var monthName = new DateTime(now.Year, i + 1, 1).ToString("MMMM"); + #> + /// + /// Returns 1st of <#= monthName #> of the current year + /// + public static DateOnly <#= monthName #> + { + get { return new DateOnly(DateTime.UtcNow.Year, <#= i + 1 #>, 1); } + } + + /// + /// Returns 1st of <#= monthName #> of the year passed in + /// + public static DateOnly <#= monthName#>Of(int year) + { + return new DateOnly(year, <#= i + 1 #>, 1); + } + <# + } + + #> + } +} +#endif \ No newline at end of file diff --git a/src/Humanizer/FluentDate/InDate.SomeTimeFrom.cs b/src/Humanizer/FluentDate/InDate.SomeTimeFrom.cs new file mode 100644 index 000000000..9a7a0fce3 --- /dev/null +++ b/src/Humanizer/FluentDate/InDate.SomeTimeFrom.cs @@ -0,0 +1,1024 @@ + +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer +{ + /// + /// + public partial class InDate + { + + /// + /// + public static class One + { + /// + /// 1 days from now + /// + public static DateOnly Day + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(1)); } + } + + /// + /// 1 days from the provided date + /// + public static DateOnly DayFrom(DateOnly date) + { + return date.AddDays(1); + } + + /// + /// 1 days from the provided date + /// + public static DateOnly DayFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(1)); + } + + /// + /// 1 weeks from now + /// + public static DateOnly Week + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(7)); } + } + + /// + /// 1 weeks from the provided date + /// + public static DateOnly WeekFrom(DateOnly date) + { + return date.AddDays(7); + } + + /// + /// 1 weeks from the provided date + /// + public static DateOnly WeekFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(7)); + } + + /// + /// 1 months from now + /// + public static DateOnly Month + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(1)); } + } + + /// + /// 1 months from the provided date + /// + public static DateOnly MonthFrom(DateOnly date) + { + return date.AddMonths(1); + } + + /// + /// 1 months from the provided date + /// + public static DateOnly MonthFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(1)); + } + + /// + /// 1 years from now + /// + public static DateOnly Year + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(1)); } + } + + /// + /// 1 years from the provided date + /// + public static DateOnly YearFrom(DateOnly date) + { + return date.AddYears(1); + } + + /// + /// 1 years from the provided date + /// + public static DateOnly YearFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(1)); + } + } + + /// + /// + public static class Two + { + /// + /// 2 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(2)); } + } + + /// + /// 2 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(2); + } + + /// + /// 2 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(2)); + } + + /// + /// 2 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(14)); } + } + + /// + /// 2 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(14); + } + + /// + /// 2 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(14)); + } + + /// + /// 2 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(2)); } + } + + /// + /// 2 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(2); + } + + /// + /// 2 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(2)); + } + + /// + /// 2 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(2)); } + } + + /// + /// 2 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(2); + } + + /// + /// 2 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(2)); + } + } + + /// + /// + public static class Three + { + /// + /// 3 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(3)); } + } + + /// + /// 3 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(3); + } + + /// + /// 3 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(3)); + } + + /// + /// 3 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(21)); } + } + + /// + /// 3 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(21); + } + + /// + /// 3 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(21)); + } + + /// + /// 3 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(3)); } + } + + /// + /// 3 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(3); + } + + /// + /// 3 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(3)); + } + + /// + /// 3 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(3)); } + } + + /// + /// 3 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(3); + } + + /// + /// 3 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(3)); + } + } + + /// + /// + public static class Four + { + /// + /// 4 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(4)); } + } + + /// + /// 4 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(4); + } + + /// + /// 4 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(4)); + } + + /// + /// 4 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(28)); } + } + + /// + /// 4 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(28); + } + + /// + /// 4 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(28)); + } + + /// + /// 4 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(4)); } + } + + /// + /// 4 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(4); + } + + /// + /// 4 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(4)); + } + + /// + /// 4 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(4)); } + } + + /// + /// 4 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(4); + } + + /// + /// 4 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(4)); + } + } + + /// + /// + public static class Five + { + /// + /// 5 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(5)); } + } + + /// + /// 5 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(5); + } + + /// + /// 5 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(5)); + } + + /// + /// 5 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(35)); } + } + + /// + /// 5 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(35); + } + + /// + /// 5 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(35)); + } + + /// + /// 5 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(5)); } + } + + /// + /// 5 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(5); + } + + /// + /// 5 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(5)); + } + + /// + /// 5 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(5)); } + } + + /// + /// 5 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(5); + } + + /// + /// 5 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(5)); + } + } + + /// + /// + public static class Six + { + /// + /// 6 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(6)); } + } + + /// + /// 6 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(6); + } + + /// + /// 6 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(6)); + } + + /// + /// 6 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(42)); } + } + + /// + /// 6 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(42); + } + + /// + /// 6 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(42)); + } + + /// + /// 6 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(6)); } + } + + /// + /// 6 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(6); + } + + /// + /// 6 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(6)); + } + + /// + /// 6 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(6)); } + } + + /// + /// 6 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(6); + } + + /// + /// 6 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(6)); + } + } + + /// + /// + public static class Seven + { + /// + /// 7 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(7)); } + } + + /// + /// 7 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(7); + } + + /// + /// 7 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(7)); + } + + /// + /// 7 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(49)); } + } + + /// + /// 7 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(49); + } + + /// + /// 7 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(49)); + } + + /// + /// 7 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(7)); } + } + + /// + /// 7 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(7); + } + + /// + /// 7 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(7)); + } + + /// + /// 7 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(7)); } + } + + /// + /// 7 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(7); + } + + /// + /// 7 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(7)); + } + } + + /// + /// + public static class Eight + { + /// + /// 8 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(8)); } + } + + /// + /// 8 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(8); + } + + /// + /// 8 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(8)); + } + + /// + /// 8 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(56)); } + } + + /// + /// 8 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(56); + } + + /// + /// 8 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(56)); + } + + /// + /// 8 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(8)); } + } + + /// + /// 8 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(8); + } + + /// + /// 8 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(8)); + } + + /// + /// 8 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(8)); } + } + + /// + /// 8 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(8); + } + + /// + /// 8 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(8)); + } + } + + /// + /// + public static class Nine + { + /// + /// 9 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(9)); } + } + + /// + /// 9 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(9); + } + + /// + /// 9 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(9)); + } + + /// + /// 9 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(63)); } + } + + /// + /// 9 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(63); + } + + /// + /// 9 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(63)); + } + + /// + /// 9 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(9)); } + } + + /// + /// 9 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(9); + } + + /// + /// 9 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(9)); + } + + /// + /// 9 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(9)); } + } + + /// + /// 9 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(9); + } + + /// + /// 9 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(9)); + } + } + + /// + /// + public static class Ten + { + /// + /// 10 days from now + /// + public static DateOnly Days + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(10)); } + } + + /// + /// 10 days from the provided date + /// + public static DateOnly DaysFrom(DateOnly date) + { + return date.AddDays(10); + } + + /// + /// 10 days from the provided date + /// + public static DateOnly DaysFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(10)); + } + + /// + /// 10 weeks from now + /// + public static DateOnly Weeks + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(70)); } + } + + /// + /// 10 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateOnly date) + { + return date.AddDays(70); + } + + /// + /// 10 weeks from the provided date + /// + public static DateOnly WeeksFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(70)); + } + + /// + /// 10 months from now + /// + public static DateOnly Months + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(10)); } + } + + /// + /// 10 months from the provided date + /// + public static DateOnly MonthsFrom(DateOnly date) + { + return date.AddMonths(10); + } + + /// + /// 10 months from the provided date + /// + public static DateOnly MonthsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(10)); + } + + /// + /// 10 years from now + /// + public static DateOnly Years + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(10)); } + } + + /// + /// 10 years from the provided date + /// + public static DateOnly YearsFrom(DateOnly date) + { + return date.AddYears(10); + } + + /// + /// 10 years from the provided date + /// + public static DateOnly YearsFrom(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(10)); + } + } + } +} +#endif \ No newline at end of file diff --git a/src/Humanizer/FluentDate/InDate.SomeTimeFrom.tt b/src/Humanizer/FluentDate/InDate.SomeTimeFrom.tt new file mode 100644 index 000000000..0c8096ff3 --- /dev/null +++ b/src/Humanizer/FluentDate/InDate.SomeTimeFrom.tt @@ -0,0 +1,135 @@ +<#@ template debug="true" hostSpecific="true" culture="en-US"#> +<#@ output extension=".cs" #> +<#@ Assembly Name="System.Core" #> +<#@ Assembly Name="System.Globalization" #> +<#@ Assembly Name="System.Windows.Forms" #> +<#@ assembly name="$(TargetPath)" #> +<#@ import namespace="System" #> +<#@ import namespace="Humanizer" #> +<#@ import namespace="System.IO" #> +<#@ import namespace="System.Diagnostics" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Collections" #> +<#@ import namespace="System.Collections.Generic" #> +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer +{ + /// + /// + public partial class InDate + { + <#for (int i = 1; i <= 10; i++){ + var plural = ( i > 1 ? "s" : ""); + + var day = "Day" + plural; + var week = "Week" + plural; + var month = "Month" + plural; + var year = "Year" + plural; + #> + /// + /// + public static class <#= i.ToWords().Dehumanize() #> + { + /// + /// <#= i #> days from now + /// + public static DateOnly <#= day #> + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(<#= i #>)); } + } + + /// + /// <#= i #> days from the provided date + /// + public static DateOnly <#= day #>From(DateOnly date) + { + return date.AddDays(<#= i #>); + } + + /// + /// <#= i #> days from the provided date + /// + public static DateOnly <#= day #>From(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(<#= i #>)); + } + + /// + /// <#= i #> weeks from now + /// + public static DateOnly <#= week #> + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddDays(<#= i * 7 #>)); } + } + + /// + /// <#= i #> weeks from the provided date + /// + public static DateOnly <#= week #>From(DateOnly date) + { + return date.AddDays(<#= i * 7 #>); + } + + /// + /// <#= i #> weeks from the provided date + /// + public static DateOnly <#= week #>From(DateTime date) + { + return DateOnly.FromDateTime(date.AddDays(<#= i * 7 #>)); + } + + /// + /// <#= i #> months from now + /// + public static DateOnly <#= month #> + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddMonths(<#= i #>)); } + } + + /// + /// <#= i #> months from the provided date + /// + public static DateOnly <#= month #>From(DateOnly date) + { + return date.AddMonths(<#= i #>); + } + + /// + /// <#= i #> months from the provided date + /// + public static DateOnly <#= month #>From(DateTime date) + { + return DateOnly.FromDateTime(date.AddMonths(<#= i #>)); + } + + /// + /// <#= i #> years from now + /// + public static DateOnly <#= year #> + { + get { return DateOnly.FromDateTime(DateTime.UtcNow.AddYears(<#= i #>)); } + } + + /// + /// <#= i #> years from the provided date + /// + public static DateOnly <#= year #>From(DateOnly date) + { + return date.AddYears(<#= i #>); + } + + /// + /// <#= i #> years from the provided date + /// + public static DateOnly <#= year #>From(DateTime date) + { + return DateOnly.FromDateTime(date.AddYears(<#= i #>)); + } + } + <#}#> + } +} +#endif \ No newline at end of file diff --git a/src/Humanizer/FluentDate/InDate.cs b/src/Humanizer/FluentDate/InDate.cs new file mode 100644 index 000000000..a5a18aa4c --- /dev/null +++ b/src/Humanizer/FluentDate/InDate.cs @@ -0,0 +1,19 @@ +#if NET6_0_OR_GREATER + +using System; +namespace Humanizer +{ + public partial class InDate + { + /// + /// Returns the first of January of the provided year + /// + /// + /// + public static DateOnly TheYear(int year) + { + return new DateOnly(year, 1, 1); + } + } +} +#endif diff --git a/src/Humanizer/FluentDate/On.Days.cs b/src/Humanizer/FluentDate/On.Days.cs index f67dbcf5f..fc784d6c0 100644 --- a/src/Humanizer/FluentDate/On.Days.cs +++ b/src/Humanizer/FluentDate/On.Days.cs @@ -1,4 +1,4 @@ - + using System; namespace Humanizer @@ -7,3101 +7,3101 @@ namespace Humanizer /// public partial class On { - + /// - /// Provides fluent date accessors for January + /// Provides fluent date accessors for January /// - public class January - { - /// - /// The nth day of January of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 1, dayNumber); - } - - /// - /// The 1st day of January of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 1, 1); } - } - - /// - /// The 2nd day of January of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 1, 2); } - } - - /// - /// The 3rd day of January of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 1, 3); } - } - - /// - /// The 4th day of January of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 1, 4); } - } - - /// - /// The 5th day of January of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 1, 5); } - } - - /// - /// The 6th day of January of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 1, 6); } - } - - /// - /// The 7th day of January of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 1, 7); } - } - - /// - /// The 8th day of January of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 1, 8); } - } - - /// - /// The 9th day of January of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 1, 9); } - } - - /// - /// The 10th day of January of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 1, 10); } - } - - /// - /// The 11th day of January of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 1, 11); } - } - - /// - /// The 12th day of January of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 1, 12); } - } - - /// - /// The 13th day of January of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 1, 13); } - } - - /// - /// The 14th day of January of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 1, 14); } - } - - /// - /// The 15th day of January of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 1, 15); } - } - - /// - /// The 16th day of January of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 1, 16); } - } - - /// - /// The 17th day of January of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 1, 17); } - } - - /// - /// The 18th day of January of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 1, 18); } - } - - /// - /// The 19th day of January of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 1, 19); } - } - - /// - /// The 20th day of January of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 1, 20); } - } - - /// - /// The 21st day of January of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 1, 21); } - } - - /// - /// The 22nd day of January of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 1, 22); } - } - - /// - /// The 23rd day of January of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 1, 23); } - } - - /// - /// The 24th day of January of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 1, 24); } - } - - /// - /// The 25th day of January of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 1, 25); } - } - - /// - /// The 26th day of January of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 1, 26); } - } - - /// - /// The 27th day of January of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 1, 27); } - } - - /// - /// The 28th day of January of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 1, 28); } - } - - /// - /// The 29th day of January of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 1, 29); } - } - - /// - /// The 30th day of January of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 1, 30); } - } - - /// - /// The 31st day of January of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 1, 31); } - } - } - + public class January + { + /// + /// The nth day of January of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 1, dayNumber); + } + + /// + /// The 1st day of January of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 1, 1); } + } + + /// + /// The 2nd day of January of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 1, 2); } + } + + /// + /// The 3rd day of January of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 1, 3); } + } + + /// + /// The 4th day of January of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 1, 4); } + } + + /// + /// The 5th day of January of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 1, 5); } + } + + /// + /// The 6th day of January of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 1, 6); } + } + + /// + /// The 7th day of January of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 1, 7); } + } + + /// + /// The 8th day of January of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 1, 8); } + } + + /// + /// The 9th day of January of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 1, 9); } + } + + /// + /// The 10th day of January of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 1, 10); } + } + + /// + /// The 11th day of January of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 1, 11); } + } + + /// + /// The 12th day of January of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 1, 12); } + } + + /// + /// The 13th day of January of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 1, 13); } + } + + /// + /// The 14th day of January of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 1, 14); } + } + + /// + /// The 15th day of January of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 1, 15); } + } + + /// + /// The 16th day of January of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 1, 16); } + } + + /// + /// The 17th day of January of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 1, 17); } + } + + /// + /// The 18th day of January of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 1, 18); } + } + + /// + /// The 19th day of January of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 1, 19); } + } + + /// + /// The 20th day of January of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 1, 20); } + } + + /// + /// The 21st day of January of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 1, 21); } + } + + /// + /// The 22nd day of January of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 1, 22); } + } + + /// + /// The 23rd day of January of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 1, 23); } + } + + /// + /// The 24th day of January of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 1, 24); } + } + + /// + /// The 25th day of January of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 1, 25); } + } + + /// + /// The 26th day of January of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 1, 26); } + } + + /// + /// The 27th day of January of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 1, 27); } + } + + /// + /// The 28th day of January of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 1, 28); } + } + + /// + /// The 29th day of January of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 1, 29); } + } + + /// + /// The 30th day of January of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 1, 30); } + } + + /// + /// The 31st day of January of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 1, 31); } + } + } + /// - /// Provides fluent date accessors for February + /// Provides fluent date accessors for February /// - public class February - { - /// - /// The nth day of February of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 2, dayNumber); - } - - /// - /// The 1st day of February of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 2, 1); } - } - - /// - /// The 2nd day of February of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 2, 2); } - } - - /// - /// The 3rd day of February of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 2, 3); } - } - - /// - /// The 4th day of February of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 2, 4); } - } - - /// - /// The 5th day of February of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 2, 5); } - } - - /// - /// The 6th day of February of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 2, 6); } - } - - /// - /// The 7th day of February of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 2, 7); } - } - - /// - /// The 8th day of February of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 2, 8); } - } - - /// - /// The 9th day of February of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 2, 9); } - } - - /// - /// The 10th day of February of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 2, 10); } - } - - /// - /// The 11th day of February of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 2, 11); } - } - - /// - /// The 12th day of February of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 2, 12); } - } - - /// - /// The 13th day of February of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 2, 13); } - } - - /// - /// The 14th day of February of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 2, 14); } - } - - /// - /// The 15th day of February of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 2, 15); } - } - - /// - /// The 16th day of February of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 2, 16); } - } - - /// - /// The 17th day of February of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 2, 17); } - } - - /// - /// The 18th day of February of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 2, 18); } - } - - /// - /// The 19th day of February of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 2, 19); } - } - - /// - /// The 20th day of February of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 2, 20); } - } - - /// - /// The 21st day of February of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 2, 21); } - } - - /// - /// The 22nd day of February of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 2, 22); } - } - - /// - /// The 23rd day of February of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 2, 23); } - } - - /// - /// The 24th day of February of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 2, 24); } - } - - /// - /// The 25th day of February of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 2, 25); } - } - - /// - /// The 26th day of February of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 2, 26); } - } - - /// - /// The 27th day of February of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 2, 27); } - } - - /// - /// The 28th day of February of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 2, 28); } - } - - /// - /// The 29th day of February of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 2, 29); } - } - } - + public class February + { + /// + /// The nth day of February of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 2, dayNumber); + } + + /// + /// The 1st day of February of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 2, 1); } + } + + /// + /// The 2nd day of February of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 2, 2); } + } + + /// + /// The 3rd day of February of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 2, 3); } + } + + /// + /// The 4th day of February of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 2, 4); } + } + + /// + /// The 5th day of February of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 2, 5); } + } + + /// + /// The 6th day of February of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 2, 6); } + } + + /// + /// The 7th day of February of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 2, 7); } + } + + /// + /// The 8th day of February of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 2, 8); } + } + + /// + /// The 9th day of February of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 2, 9); } + } + + /// + /// The 10th day of February of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 2, 10); } + } + + /// + /// The 11th day of February of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 2, 11); } + } + + /// + /// The 12th day of February of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 2, 12); } + } + + /// + /// The 13th day of February of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 2, 13); } + } + + /// + /// The 14th day of February of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 2, 14); } + } + + /// + /// The 15th day of February of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 2, 15); } + } + + /// + /// The 16th day of February of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 2, 16); } + } + + /// + /// The 17th day of February of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 2, 17); } + } + + /// + /// The 18th day of February of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 2, 18); } + } + + /// + /// The 19th day of February of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 2, 19); } + } + + /// + /// The 20th day of February of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 2, 20); } + } + + /// + /// The 21st day of February of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 2, 21); } + } + + /// + /// The 22nd day of February of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 2, 22); } + } + + /// + /// The 23rd day of February of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 2, 23); } + } + + /// + /// The 24th day of February of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 2, 24); } + } + + /// + /// The 25th day of February of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 2, 25); } + } + + /// + /// The 26th day of February of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 2, 26); } + } + + /// + /// The 27th day of February of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 2, 27); } + } + + /// + /// The 28th day of February of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 2, 28); } + } + + /// + /// The 29th day of February of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 2, 29); } + } + } + /// - /// Provides fluent date accessors for March + /// Provides fluent date accessors for March /// - public class March - { - /// - /// The nth day of March of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 3, dayNumber); - } - - /// - /// The 1st day of March of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 3, 1); } - } - - /// - /// The 2nd day of March of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 3, 2); } - } - - /// - /// The 3rd day of March of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 3, 3); } - } - - /// - /// The 4th day of March of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 3, 4); } - } - - /// - /// The 5th day of March of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 3, 5); } - } - - /// - /// The 6th day of March of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 3, 6); } - } - - /// - /// The 7th day of March of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 3, 7); } - } - - /// - /// The 8th day of March of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 3, 8); } - } - - /// - /// The 9th day of March of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 3, 9); } - } - - /// - /// The 10th day of March of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 3, 10); } - } - - /// - /// The 11th day of March of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 3, 11); } - } - - /// - /// The 12th day of March of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 3, 12); } - } - - /// - /// The 13th day of March of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 3, 13); } - } - - /// - /// The 14th day of March of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 3, 14); } - } - - /// - /// The 15th day of March of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 3, 15); } - } - - /// - /// The 16th day of March of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 3, 16); } - } - - /// - /// The 17th day of March of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 3, 17); } - } - - /// - /// The 18th day of March of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 3, 18); } - } - - /// - /// The 19th day of March of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 3, 19); } - } - - /// - /// The 20th day of March of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 3, 20); } - } - - /// - /// The 21st day of March of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 3, 21); } - } - - /// - /// The 22nd day of March of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 3, 22); } - } - - /// - /// The 23rd day of March of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 3, 23); } - } - - /// - /// The 24th day of March of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 3, 24); } - } - - /// - /// The 25th day of March of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 3, 25); } - } - - /// - /// The 26th day of March of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 3, 26); } - } - - /// - /// The 27th day of March of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 3, 27); } - } - - /// - /// The 28th day of March of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 3, 28); } - } - - /// - /// The 29th day of March of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 3, 29); } - } - - /// - /// The 30th day of March of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 3, 30); } - } - - /// - /// The 31st day of March of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 3, 31); } - } - } - + public class March + { + /// + /// The nth day of March of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 3, dayNumber); + } + + /// + /// The 1st day of March of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 3, 1); } + } + + /// + /// The 2nd day of March of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 3, 2); } + } + + /// + /// The 3rd day of March of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 3, 3); } + } + + /// + /// The 4th day of March of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 3, 4); } + } + + /// + /// The 5th day of March of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 3, 5); } + } + + /// + /// The 6th day of March of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 3, 6); } + } + + /// + /// The 7th day of March of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 3, 7); } + } + + /// + /// The 8th day of March of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 3, 8); } + } + + /// + /// The 9th day of March of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 3, 9); } + } + + /// + /// The 10th day of March of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 3, 10); } + } + + /// + /// The 11th day of March of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 3, 11); } + } + + /// + /// The 12th day of March of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 3, 12); } + } + + /// + /// The 13th day of March of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 3, 13); } + } + + /// + /// The 14th day of March of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 3, 14); } + } + + /// + /// The 15th day of March of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 3, 15); } + } + + /// + /// The 16th day of March of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 3, 16); } + } + + /// + /// The 17th day of March of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 3, 17); } + } + + /// + /// The 18th day of March of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 3, 18); } + } + + /// + /// The 19th day of March of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 3, 19); } + } + + /// + /// The 20th day of March of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 3, 20); } + } + + /// + /// The 21st day of March of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 3, 21); } + } + + /// + /// The 22nd day of March of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 3, 22); } + } + + /// + /// The 23rd day of March of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 3, 23); } + } + + /// + /// The 24th day of March of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 3, 24); } + } + + /// + /// The 25th day of March of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 3, 25); } + } + + /// + /// The 26th day of March of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 3, 26); } + } + + /// + /// The 27th day of March of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 3, 27); } + } + + /// + /// The 28th day of March of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 3, 28); } + } + + /// + /// The 29th day of March of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 3, 29); } + } + + /// + /// The 30th day of March of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 3, 30); } + } + + /// + /// The 31st day of March of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 3, 31); } + } + } + /// - /// Provides fluent date accessors for April + /// Provides fluent date accessors for April /// - public class April - { - /// - /// The nth day of April of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 4, dayNumber); - } - - /// - /// The 1st day of April of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 4, 1); } - } - - /// - /// The 2nd day of April of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 4, 2); } - } - - /// - /// The 3rd day of April of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 4, 3); } - } - - /// - /// The 4th day of April of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 4, 4); } - } - - /// - /// The 5th day of April of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 4, 5); } - } - - /// - /// The 6th day of April of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 4, 6); } - } - - /// - /// The 7th day of April of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 4, 7); } - } - - /// - /// The 8th day of April of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 4, 8); } - } - - /// - /// The 9th day of April of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 4, 9); } - } - - /// - /// The 10th day of April of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 4, 10); } - } - - /// - /// The 11th day of April of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 4, 11); } - } - - /// - /// The 12th day of April of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 4, 12); } - } - - /// - /// The 13th day of April of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 4, 13); } - } - - /// - /// The 14th day of April of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 4, 14); } - } - - /// - /// The 15th day of April of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 4, 15); } - } - - /// - /// The 16th day of April of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 4, 16); } - } - - /// - /// The 17th day of April of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 4, 17); } - } - - /// - /// The 18th day of April of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 4, 18); } - } - - /// - /// The 19th day of April of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 4, 19); } - } - - /// - /// The 20th day of April of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 4, 20); } - } - - /// - /// The 21st day of April of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 4, 21); } - } - - /// - /// The 22nd day of April of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 4, 22); } - } - - /// - /// The 23rd day of April of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 4, 23); } - } - - /// - /// The 24th day of April of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 4, 24); } - } - - /// - /// The 25th day of April of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 4, 25); } - } - - /// - /// The 26th day of April of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 4, 26); } - } - - /// - /// The 27th day of April of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 4, 27); } - } - - /// - /// The 28th day of April of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 4, 28); } - } - - /// - /// The 29th day of April of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 4, 29); } - } - - /// - /// The 30th day of April of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 4, 30); } - } - } - + public class April + { + /// + /// The nth day of April of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 4, dayNumber); + } + + /// + /// The 1st day of April of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 4, 1); } + } + + /// + /// The 2nd day of April of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 4, 2); } + } + + /// + /// The 3rd day of April of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 4, 3); } + } + + /// + /// The 4th day of April of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 4, 4); } + } + + /// + /// The 5th day of April of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 4, 5); } + } + + /// + /// The 6th day of April of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 4, 6); } + } + + /// + /// The 7th day of April of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 4, 7); } + } + + /// + /// The 8th day of April of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 4, 8); } + } + + /// + /// The 9th day of April of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 4, 9); } + } + + /// + /// The 10th day of April of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 4, 10); } + } + + /// + /// The 11th day of April of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 4, 11); } + } + + /// + /// The 12th day of April of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 4, 12); } + } + + /// + /// The 13th day of April of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 4, 13); } + } + + /// + /// The 14th day of April of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 4, 14); } + } + + /// + /// The 15th day of April of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 4, 15); } + } + + /// + /// The 16th day of April of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 4, 16); } + } + + /// + /// The 17th day of April of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 4, 17); } + } + + /// + /// The 18th day of April of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 4, 18); } + } + + /// + /// The 19th day of April of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 4, 19); } + } + + /// + /// The 20th day of April of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 4, 20); } + } + + /// + /// The 21st day of April of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 4, 21); } + } + + /// + /// The 22nd day of April of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 4, 22); } + } + + /// + /// The 23rd day of April of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 4, 23); } + } + + /// + /// The 24th day of April of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 4, 24); } + } + + /// + /// The 25th day of April of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 4, 25); } + } + + /// + /// The 26th day of April of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 4, 26); } + } + + /// + /// The 27th day of April of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 4, 27); } + } + + /// + /// The 28th day of April of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 4, 28); } + } + + /// + /// The 29th day of April of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 4, 29); } + } + + /// + /// The 30th day of April of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 4, 30); } + } + } + /// - /// Provides fluent date accessors for May + /// Provides fluent date accessors for May /// - public class May - { - /// - /// The nth day of May of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 5, dayNumber); - } - - /// - /// The 1st day of May of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 5, 1); } - } - - /// - /// The 2nd day of May of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 5, 2); } - } - - /// - /// The 3rd day of May of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 5, 3); } - } - - /// - /// The 4th day of May of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 5, 4); } - } - - /// - /// The 5th day of May of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 5, 5); } - } - - /// - /// The 6th day of May of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 5, 6); } - } - - /// - /// The 7th day of May of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 5, 7); } - } - - /// - /// The 8th day of May of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 5, 8); } - } - - /// - /// The 9th day of May of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 5, 9); } - } - - /// - /// The 10th day of May of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 5, 10); } - } - - /// - /// The 11th day of May of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 5, 11); } - } - - /// - /// The 12th day of May of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 5, 12); } - } - - /// - /// The 13th day of May of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 5, 13); } - } - - /// - /// The 14th day of May of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 5, 14); } - } - - /// - /// The 15th day of May of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 5, 15); } - } - - /// - /// The 16th day of May of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 5, 16); } - } - - /// - /// The 17th day of May of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 5, 17); } - } - - /// - /// The 18th day of May of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 5, 18); } - } - - /// - /// The 19th day of May of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 5, 19); } - } - - /// - /// The 20th day of May of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 5, 20); } - } - - /// - /// The 21st day of May of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 5, 21); } - } - - /// - /// The 22nd day of May of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 5, 22); } - } - - /// - /// The 23rd day of May of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 5, 23); } - } - - /// - /// The 24th day of May of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 5, 24); } - } - - /// - /// The 25th day of May of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 5, 25); } - } - - /// - /// The 26th day of May of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 5, 26); } - } - - /// - /// The 27th day of May of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 5, 27); } - } - - /// - /// The 28th day of May of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 5, 28); } - } - - /// - /// The 29th day of May of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 5, 29); } - } - - /// - /// The 30th day of May of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 5, 30); } - } - - /// - /// The 31st day of May of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 5, 31); } - } - } - + public class May + { + /// + /// The nth day of May of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 5, dayNumber); + } + + /// + /// The 1st day of May of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 5, 1); } + } + + /// + /// The 2nd day of May of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 5, 2); } + } + + /// + /// The 3rd day of May of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 5, 3); } + } + + /// + /// The 4th day of May of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 5, 4); } + } + + /// + /// The 5th day of May of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 5, 5); } + } + + /// + /// The 6th day of May of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 5, 6); } + } + + /// + /// The 7th day of May of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 5, 7); } + } + + /// + /// The 8th day of May of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 5, 8); } + } + + /// + /// The 9th day of May of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 5, 9); } + } + + /// + /// The 10th day of May of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 5, 10); } + } + + /// + /// The 11th day of May of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 5, 11); } + } + + /// + /// The 12th day of May of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 5, 12); } + } + + /// + /// The 13th day of May of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 5, 13); } + } + + /// + /// The 14th day of May of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 5, 14); } + } + + /// + /// The 15th day of May of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 5, 15); } + } + + /// + /// The 16th day of May of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 5, 16); } + } + + /// + /// The 17th day of May of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 5, 17); } + } + + /// + /// The 18th day of May of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 5, 18); } + } + + /// + /// The 19th day of May of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 5, 19); } + } + + /// + /// The 20th day of May of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 5, 20); } + } + + /// + /// The 21st day of May of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 5, 21); } + } + + /// + /// The 22nd day of May of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 5, 22); } + } + + /// + /// The 23rd day of May of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 5, 23); } + } + + /// + /// The 24th day of May of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 5, 24); } + } + + /// + /// The 25th day of May of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 5, 25); } + } + + /// + /// The 26th day of May of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 5, 26); } + } + + /// + /// The 27th day of May of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 5, 27); } + } + + /// + /// The 28th day of May of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 5, 28); } + } + + /// + /// The 29th day of May of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 5, 29); } + } + + /// + /// The 30th day of May of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 5, 30); } + } + + /// + /// The 31st day of May of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 5, 31); } + } + } + /// - /// Provides fluent date accessors for June + /// Provides fluent date accessors for June /// - public class June - { - /// - /// The nth day of June of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 6, dayNumber); - } - - /// - /// The 1st day of June of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 6, 1); } - } - - /// - /// The 2nd day of June of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 6, 2); } - } - - /// - /// The 3rd day of June of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 6, 3); } - } - - /// - /// The 4th day of June of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 6, 4); } - } - - /// - /// The 5th day of June of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 6, 5); } - } - - /// - /// The 6th day of June of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 6, 6); } - } - - /// - /// The 7th day of June of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 6, 7); } - } - - /// - /// The 8th day of June of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 6, 8); } - } - - /// - /// The 9th day of June of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 6, 9); } - } - - /// - /// The 10th day of June of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 6, 10); } - } - - /// - /// The 11th day of June of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 6, 11); } - } - - /// - /// The 12th day of June of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 6, 12); } - } - - /// - /// The 13th day of June of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 6, 13); } - } - - /// - /// The 14th day of June of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 6, 14); } - } - - /// - /// The 15th day of June of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 6, 15); } - } - - /// - /// The 16th day of June of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 6, 16); } - } - - /// - /// The 17th day of June of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 6, 17); } - } - - /// - /// The 18th day of June of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 6, 18); } - } - - /// - /// The 19th day of June of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 6, 19); } - } - - /// - /// The 20th day of June of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 6, 20); } - } - - /// - /// The 21st day of June of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 6, 21); } - } - - /// - /// The 22nd day of June of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 6, 22); } - } - - /// - /// The 23rd day of June of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 6, 23); } - } - - /// - /// The 24th day of June of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 6, 24); } - } - - /// - /// The 25th day of June of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 6, 25); } - } - - /// - /// The 26th day of June of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 6, 26); } - } - - /// - /// The 27th day of June of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 6, 27); } - } - - /// - /// The 28th day of June of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 6, 28); } - } - - /// - /// The 29th day of June of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 6, 29); } - } - - /// - /// The 30th day of June of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 6, 30); } - } - } - + public class June + { + /// + /// The nth day of June of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 6, dayNumber); + } + + /// + /// The 1st day of June of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 6, 1); } + } + + /// + /// The 2nd day of June of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 6, 2); } + } + + /// + /// The 3rd day of June of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 6, 3); } + } + + /// + /// The 4th day of June of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 6, 4); } + } + + /// + /// The 5th day of June of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 6, 5); } + } + + /// + /// The 6th day of June of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 6, 6); } + } + + /// + /// The 7th day of June of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 6, 7); } + } + + /// + /// The 8th day of June of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 6, 8); } + } + + /// + /// The 9th day of June of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 6, 9); } + } + + /// + /// The 10th day of June of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 6, 10); } + } + + /// + /// The 11th day of June of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 6, 11); } + } + + /// + /// The 12th day of June of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 6, 12); } + } + + /// + /// The 13th day of June of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 6, 13); } + } + + /// + /// The 14th day of June of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 6, 14); } + } + + /// + /// The 15th day of June of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 6, 15); } + } + + /// + /// The 16th day of June of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 6, 16); } + } + + /// + /// The 17th day of June of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 6, 17); } + } + + /// + /// The 18th day of June of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 6, 18); } + } + + /// + /// The 19th day of June of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 6, 19); } + } + + /// + /// The 20th day of June of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 6, 20); } + } + + /// + /// The 21st day of June of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 6, 21); } + } + + /// + /// The 22nd day of June of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 6, 22); } + } + + /// + /// The 23rd day of June of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 6, 23); } + } + + /// + /// The 24th day of June of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 6, 24); } + } + + /// + /// The 25th day of June of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 6, 25); } + } + + /// + /// The 26th day of June of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 6, 26); } + } + + /// + /// The 27th day of June of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 6, 27); } + } + + /// + /// The 28th day of June of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 6, 28); } + } + + /// + /// The 29th day of June of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 6, 29); } + } + + /// + /// The 30th day of June of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 6, 30); } + } + } + /// - /// Provides fluent date accessors for July + /// Provides fluent date accessors for July /// - public class July - { - /// - /// The nth day of July of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 7, dayNumber); - } - - /// - /// The 1st day of July of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 7, 1); } - } - - /// - /// The 2nd day of July of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 7, 2); } - } - - /// - /// The 3rd day of July of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 7, 3); } - } - - /// - /// The 4th day of July of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 7, 4); } - } - - /// - /// The 5th day of July of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 7, 5); } - } - - /// - /// The 6th day of July of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 7, 6); } - } - - /// - /// The 7th day of July of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 7, 7); } - } - - /// - /// The 8th day of July of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 7, 8); } - } - - /// - /// The 9th day of July of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 7, 9); } - } - - /// - /// The 10th day of July of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 7, 10); } - } - - /// - /// The 11th day of July of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 7, 11); } - } - - /// - /// The 12th day of July of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 7, 12); } - } - - /// - /// The 13th day of July of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 7, 13); } - } - - /// - /// The 14th day of July of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 7, 14); } - } - - /// - /// The 15th day of July of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 7, 15); } - } - - /// - /// The 16th day of July of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 7, 16); } - } - - /// - /// The 17th day of July of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 7, 17); } - } - - /// - /// The 18th day of July of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 7, 18); } - } - - /// - /// The 19th day of July of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 7, 19); } - } - - /// - /// The 20th day of July of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 7, 20); } - } - - /// - /// The 21st day of July of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 7, 21); } - } - - /// - /// The 22nd day of July of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 7, 22); } - } - - /// - /// The 23rd day of July of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 7, 23); } - } - - /// - /// The 24th day of July of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 7, 24); } - } - - /// - /// The 25th day of July of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 7, 25); } - } - - /// - /// The 26th day of July of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 7, 26); } - } - - /// - /// The 27th day of July of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 7, 27); } - } - - /// - /// The 28th day of July of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 7, 28); } - } - - /// - /// The 29th day of July of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 7, 29); } - } - - /// - /// The 30th day of July of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 7, 30); } - } - - /// - /// The 31st day of July of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 7, 31); } - } - } - + public class July + { + /// + /// The nth day of July of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 7, dayNumber); + } + + /// + /// The 1st day of July of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 7, 1); } + } + + /// + /// The 2nd day of July of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 7, 2); } + } + + /// + /// The 3rd day of July of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 7, 3); } + } + + /// + /// The 4th day of July of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 7, 4); } + } + + /// + /// The 5th day of July of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 7, 5); } + } + + /// + /// The 6th day of July of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 7, 6); } + } + + /// + /// The 7th day of July of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 7, 7); } + } + + /// + /// The 8th day of July of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 7, 8); } + } + + /// + /// The 9th day of July of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 7, 9); } + } + + /// + /// The 10th day of July of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 7, 10); } + } + + /// + /// The 11th day of July of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 7, 11); } + } + + /// + /// The 12th day of July of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 7, 12); } + } + + /// + /// The 13th day of July of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 7, 13); } + } + + /// + /// The 14th day of July of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 7, 14); } + } + + /// + /// The 15th day of July of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 7, 15); } + } + + /// + /// The 16th day of July of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 7, 16); } + } + + /// + /// The 17th day of July of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 7, 17); } + } + + /// + /// The 18th day of July of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 7, 18); } + } + + /// + /// The 19th day of July of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 7, 19); } + } + + /// + /// The 20th day of July of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 7, 20); } + } + + /// + /// The 21st day of July of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 7, 21); } + } + + /// + /// The 22nd day of July of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 7, 22); } + } + + /// + /// The 23rd day of July of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 7, 23); } + } + + /// + /// The 24th day of July of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 7, 24); } + } + + /// + /// The 25th day of July of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 7, 25); } + } + + /// + /// The 26th day of July of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 7, 26); } + } + + /// + /// The 27th day of July of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 7, 27); } + } + + /// + /// The 28th day of July of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 7, 28); } + } + + /// + /// The 29th day of July of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 7, 29); } + } + + /// + /// The 30th day of July of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 7, 30); } + } + + /// + /// The 31st day of July of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 7, 31); } + } + } + /// - /// Provides fluent date accessors for August + /// Provides fluent date accessors for August /// - public class August - { - /// - /// The nth day of August of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 8, dayNumber); - } - - /// - /// The 1st day of August of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 8, 1); } - } - - /// - /// The 2nd day of August of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 8, 2); } - } - - /// - /// The 3rd day of August of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 8, 3); } - } - - /// - /// The 4th day of August of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 8, 4); } - } - - /// - /// The 5th day of August of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 8, 5); } - } - - /// - /// The 6th day of August of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 8, 6); } - } - - /// - /// The 7th day of August of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 8, 7); } - } - - /// - /// The 8th day of August of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 8, 8); } - } - - /// - /// The 9th day of August of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 8, 9); } - } - - /// - /// The 10th day of August of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 8, 10); } - } - - /// - /// The 11th day of August of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 8, 11); } - } - - /// - /// The 12th day of August of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 8, 12); } - } - - /// - /// The 13th day of August of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 8, 13); } - } - - /// - /// The 14th day of August of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 8, 14); } - } - - /// - /// The 15th day of August of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 8, 15); } - } - - /// - /// The 16th day of August of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 8, 16); } - } - - /// - /// The 17th day of August of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 8, 17); } - } - - /// - /// The 18th day of August of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 8, 18); } - } - - /// - /// The 19th day of August of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 8, 19); } - } - - /// - /// The 20th day of August of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 8, 20); } - } - - /// - /// The 21st day of August of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 8, 21); } - } - - /// - /// The 22nd day of August of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 8, 22); } - } - - /// - /// The 23rd day of August of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 8, 23); } - } - - /// - /// The 24th day of August of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 8, 24); } - } - - /// - /// The 25th day of August of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 8, 25); } - } - - /// - /// The 26th day of August of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 8, 26); } - } - - /// - /// The 27th day of August of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 8, 27); } - } - - /// - /// The 28th day of August of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 8, 28); } - } - - /// - /// The 29th day of August of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 8, 29); } - } - - /// - /// The 30th day of August of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 8, 30); } - } - - /// - /// The 31st day of August of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 8, 31); } - } - } - + public class August + { + /// + /// The nth day of August of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 8, dayNumber); + } + + /// + /// The 1st day of August of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 8, 1); } + } + + /// + /// The 2nd day of August of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 8, 2); } + } + + /// + /// The 3rd day of August of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 8, 3); } + } + + /// + /// The 4th day of August of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 8, 4); } + } + + /// + /// The 5th day of August of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 8, 5); } + } + + /// + /// The 6th day of August of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 8, 6); } + } + + /// + /// The 7th day of August of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 8, 7); } + } + + /// + /// The 8th day of August of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 8, 8); } + } + + /// + /// The 9th day of August of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 8, 9); } + } + + /// + /// The 10th day of August of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 8, 10); } + } + + /// + /// The 11th day of August of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 8, 11); } + } + + /// + /// The 12th day of August of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 8, 12); } + } + + /// + /// The 13th day of August of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 8, 13); } + } + + /// + /// The 14th day of August of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 8, 14); } + } + + /// + /// The 15th day of August of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 8, 15); } + } + + /// + /// The 16th day of August of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 8, 16); } + } + + /// + /// The 17th day of August of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 8, 17); } + } + + /// + /// The 18th day of August of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 8, 18); } + } + + /// + /// The 19th day of August of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 8, 19); } + } + + /// + /// The 20th day of August of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 8, 20); } + } + + /// + /// The 21st day of August of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 8, 21); } + } + + /// + /// The 22nd day of August of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 8, 22); } + } + + /// + /// The 23rd day of August of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 8, 23); } + } + + /// + /// The 24th day of August of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 8, 24); } + } + + /// + /// The 25th day of August of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 8, 25); } + } + + /// + /// The 26th day of August of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 8, 26); } + } + + /// + /// The 27th day of August of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 8, 27); } + } + + /// + /// The 28th day of August of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 8, 28); } + } + + /// + /// The 29th day of August of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 8, 29); } + } + + /// + /// The 30th day of August of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 8, 30); } + } + + /// + /// The 31st day of August of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 8, 31); } + } + } + /// - /// Provides fluent date accessors for September + /// Provides fluent date accessors for September /// - public class September - { - /// - /// The nth day of September of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 9, dayNumber); - } - - /// - /// The 1st day of September of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 9, 1); } - } - - /// - /// The 2nd day of September of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 9, 2); } - } - - /// - /// The 3rd day of September of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 9, 3); } - } - - /// - /// The 4th day of September of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 9, 4); } - } - - /// - /// The 5th day of September of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 9, 5); } - } - - /// - /// The 6th day of September of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 9, 6); } - } - - /// - /// The 7th day of September of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 9, 7); } - } - - /// - /// The 8th day of September of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 9, 8); } - } - - /// - /// The 9th day of September of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 9, 9); } - } - - /// - /// The 10th day of September of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 9, 10); } - } - - /// - /// The 11th day of September of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 9, 11); } - } - - /// - /// The 12th day of September of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 9, 12); } - } - - /// - /// The 13th day of September of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 9, 13); } - } - - /// - /// The 14th day of September of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 9, 14); } - } - - /// - /// The 15th day of September of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 9, 15); } - } - - /// - /// The 16th day of September of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 9, 16); } - } - - /// - /// The 17th day of September of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 9, 17); } - } - - /// - /// The 18th day of September of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 9, 18); } - } - - /// - /// The 19th day of September of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 9, 19); } - } - - /// - /// The 20th day of September of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 9, 20); } - } - - /// - /// The 21st day of September of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 9, 21); } - } - - /// - /// The 22nd day of September of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 9, 22); } - } - - /// - /// The 23rd day of September of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 9, 23); } - } - - /// - /// The 24th day of September of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 9, 24); } - } - - /// - /// The 25th day of September of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 9, 25); } - } - - /// - /// The 26th day of September of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 9, 26); } - } - - /// - /// The 27th day of September of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 9, 27); } - } - - /// - /// The 28th day of September of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 9, 28); } - } - - /// - /// The 29th day of September of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 9, 29); } - } - - /// - /// The 30th day of September of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 9, 30); } - } - } - + public class September + { + /// + /// The nth day of September of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 9, dayNumber); + } + + /// + /// The 1st day of September of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 9, 1); } + } + + /// + /// The 2nd day of September of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 9, 2); } + } + + /// + /// The 3rd day of September of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 9, 3); } + } + + /// + /// The 4th day of September of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 9, 4); } + } + + /// + /// The 5th day of September of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 9, 5); } + } + + /// + /// The 6th day of September of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 9, 6); } + } + + /// + /// The 7th day of September of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 9, 7); } + } + + /// + /// The 8th day of September of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 9, 8); } + } + + /// + /// The 9th day of September of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 9, 9); } + } + + /// + /// The 10th day of September of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 9, 10); } + } + + /// + /// The 11th day of September of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 9, 11); } + } + + /// + /// The 12th day of September of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 9, 12); } + } + + /// + /// The 13th day of September of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 9, 13); } + } + + /// + /// The 14th day of September of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 9, 14); } + } + + /// + /// The 15th day of September of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 9, 15); } + } + + /// + /// The 16th day of September of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 9, 16); } + } + + /// + /// The 17th day of September of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 9, 17); } + } + + /// + /// The 18th day of September of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 9, 18); } + } + + /// + /// The 19th day of September of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 9, 19); } + } + + /// + /// The 20th day of September of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 9, 20); } + } + + /// + /// The 21st day of September of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 9, 21); } + } + + /// + /// The 22nd day of September of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 9, 22); } + } + + /// + /// The 23rd day of September of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 9, 23); } + } + + /// + /// The 24th day of September of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 9, 24); } + } + + /// + /// The 25th day of September of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 9, 25); } + } + + /// + /// The 26th day of September of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 9, 26); } + } + + /// + /// The 27th day of September of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 9, 27); } + } + + /// + /// The 28th day of September of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 9, 28); } + } + + /// + /// The 29th day of September of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 9, 29); } + } + + /// + /// The 30th day of September of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 9, 30); } + } + } + /// - /// Provides fluent date accessors for October + /// Provides fluent date accessors for October /// - public class October - { - /// - /// The nth day of October of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 10, dayNumber); - } - - /// - /// The 1st day of October of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 10, 1); } - } - - /// - /// The 2nd day of October of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 10, 2); } - } - - /// - /// The 3rd day of October of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 10, 3); } - } - - /// - /// The 4th day of October of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 10, 4); } - } - - /// - /// The 5th day of October of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 10, 5); } - } - - /// - /// The 6th day of October of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 10, 6); } - } - - /// - /// The 7th day of October of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 10, 7); } - } - - /// - /// The 8th day of October of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 10, 8); } - } - - /// - /// The 9th day of October of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 10, 9); } - } - - /// - /// The 10th day of October of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 10, 10); } - } - - /// - /// The 11th day of October of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 10, 11); } - } - - /// - /// The 12th day of October of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 10, 12); } - } - - /// - /// The 13th day of October of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 10, 13); } - } - - /// - /// The 14th day of October of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 10, 14); } - } - - /// - /// The 15th day of October of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 10, 15); } - } - - /// - /// The 16th day of October of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 10, 16); } - } - - /// - /// The 17th day of October of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 10, 17); } - } - - /// - /// The 18th day of October of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 10, 18); } - } - - /// - /// The 19th day of October of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 10, 19); } - } - - /// - /// The 20th day of October of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 10, 20); } - } - - /// - /// The 21st day of October of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 10, 21); } - } - - /// - /// The 22nd day of October of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 10, 22); } - } - - /// - /// The 23rd day of October of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 10, 23); } - } - - /// - /// The 24th day of October of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 10, 24); } - } - - /// - /// The 25th day of October of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 10, 25); } - } - - /// - /// The 26th day of October of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 10, 26); } - } - - /// - /// The 27th day of October of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 10, 27); } - } - - /// - /// The 28th day of October of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 10, 28); } - } - - /// - /// The 29th day of October of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 10, 29); } - } - - /// - /// The 30th day of October of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 10, 30); } - } - - /// - /// The 31st day of October of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 10, 31); } - } - } - + public class October + { + /// + /// The nth day of October of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 10, dayNumber); + } + + /// + /// The 1st day of October of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 10, 1); } + } + + /// + /// The 2nd day of October of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 10, 2); } + } + + /// + /// The 3rd day of October of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 10, 3); } + } + + /// + /// The 4th day of October of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 10, 4); } + } + + /// + /// The 5th day of October of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 10, 5); } + } + + /// + /// The 6th day of October of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 10, 6); } + } + + /// + /// The 7th day of October of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 10, 7); } + } + + /// + /// The 8th day of October of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 10, 8); } + } + + /// + /// The 9th day of October of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 10, 9); } + } + + /// + /// The 10th day of October of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 10, 10); } + } + + /// + /// The 11th day of October of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 10, 11); } + } + + /// + /// The 12th day of October of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 10, 12); } + } + + /// + /// The 13th day of October of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 10, 13); } + } + + /// + /// The 14th day of October of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 10, 14); } + } + + /// + /// The 15th day of October of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 10, 15); } + } + + /// + /// The 16th day of October of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 10, 16); } + } + + /// + /// The 17th day of October of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 10, 17); } + } + + /// + /// The 18th day of October of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 10, 18); } + } + + /// + /// The 19th day of October of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 10, 19); } + } + + /// + /// The 20th day of October of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 10, 20); } + } + + /// + /// The 21st day of October of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 10, 21); } + } + + /// + /// The 22nd day of October of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 10, 22); } + } + + /// + /// The 23rd day of October of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 10, 23); } + } + + /// + /// The 24th day of October of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 10, 24); } + } + + /// + /// The 25th day of October of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 10, 25); } + } + + /// + /// The 26th day of October of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 10, 26); } + } + + /// + /// The 27th day of October of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 10, 27); } + } + + /// + /// The 28th day of October of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 10, 28); } + } + + /// + /// The 29th day of October of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 10, 29); } + } + + /// + /// The 30th day of October of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 10, 30); } + } + + /// + /// The 31st day of October of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 10, 31); } + } + } + /// - /// Provides fluent date accessors for November + /// Provides fluent date accessors for November /// - public class November - { - /// - /// The nth day of November of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 11, dayNumber); - } - - /// - /// The 1st day of November of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 11, 1); } - } - - /// - /// The 2nd day of November of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 11, 2); } - } - - /// - /// The 3rd day of November of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 11, 3); } - } - - /// - /// The 4th day of November of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 11, 4); } - } - - /// - /// The 5th day of November of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 11, 5); } - } - - /// - /// The 6th day of November of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 11, 6); } - } - - /// - /// The 7th day of November of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 11, 7); } - } - - /// - /// The 8th day of November of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 11, 8); } - } - - /// - /// The 9th day of November of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 11, 9); } - } - - /// - /// The 10th day of November of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 11, 10); } - } - - /// - /// The 11th day of November of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 11, 11); } - } - - /// - /// The 12th day of November of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 11, 12); } - } - - /// - /// The 13th day of November of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 11, 13); } - } - - /// - /// The 14th day of November of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 11, 14); } - } - - /// - /// The 15th day of November of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 11, 15); } - } - - /// - /// The 16th day of November of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 11, 16); } - } - - /// - /// The 17th day of November of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 11, 17); } - } - - /// - /// The 18th day of November of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 11, 18); } - } - - /// - /// The 19th day of November of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 11, 19); } - } - - /// - /// The 20th day of November of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 11, 20); } - } - - /// - /// The 21st day of November of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 11, 21); } - } - - /// - /// The 22nd day of November of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 11, 22); } - } - - /// - /// The 23rd day of November of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 11, 23); } - } - - /// - /// The 24th day of November of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 11, 24); } - } - - /// - /// The 25th day of November of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 11, 25); } - } - - /// - /// The 26th day of November of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 11, 26); } - } - - /// - /// The 27th day of November of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 11, 27); } - } - - /// - /// The 28th day of November of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 11, 28); } - } - - /// - /// The 29th day of November of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 11, 29); } - } - - /// - /// The 30th day of November of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 11, 30); } - } - } - + public class November + { + /// + /// The nth day of November of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 11, dayNumber); + } + + /// + /// The 1st day of November of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 11, 1); } + } + + /// + /// The 2nd day of November of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 11, 2); } + } + + /// + /// The 3rd day of November of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 11, 3); } + } + + /// + /// The 4th day of November of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 11, 4); } + } + + /// + /// The 5th day of November of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 11, 5); } + } + + /// + /// The 6th day of November of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 11, 6); } + } + + /// + /// The 7th day of November of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 11, 7); } + } + + /// + /// The 8th day of November of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 11, 8); } + } + + /// + /// The 9th day of November of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 11, 9); } + } + + /// + /// The 10th day of November of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 11, 10); } + } + + /// + /// The 11th day of November of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 11, 11); } + } + + /// + /// The 12th day of November of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 11, 12); } + } + + /// + /// The 13th day of November of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 11, 13); } + } + + /// + /// The 14th day of November of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 11, 14); } + } + + /// + /// The 15th day of November of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 11, 15); } + } + + /// + /// The 16th day of November of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 11, 16); } + } + + /// + /// The 17th day of November of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 11, 17); } + } + + /// + /// The 18th day of November of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 11, 18); } + } + + /// + /// The 19th day of November of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 11, 19); } + } + + /// + /// The 20th day of November of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 11, 20); } + } + + /// + /// The 21st day of November of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 11, 21); } + } + + /// + /// The 22nd day of November of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 11, 22); } + } + + /// + /// The 23rd day of November of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 11, 23); } + } + + /// + /// The 24th day of November of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 11, 24); } + } + + /// + /// The 25th day of November of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 11, 25); } + } + + /// + /// The 26th day of November of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 11, 26); } + } + + /// + /// The 27th day of November of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 11, 27); } + } + + /// + /// The 28th day of November of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 11, 28); } + } + + /// + /// The 29th day of November of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 11, 29); } + } + + /// + /// The 30th day of November of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 11, 30); } + } + } + /// - /// Provides fluent date accessors for December + /// Provides fluent date accessors for December /// - public class December - { - /// - /// The nth day of December of the current year - /// - public static DateTime The(int dayNumber) - { - return new DateTime(DateTime.Now.Year, 12, dayNumber); - } - - /// - /// The 1st day of December of the current year - /// - public static DateTime The1st - { - get { return new DateTime(DateTime.Now.Year, 12, 1); } - } - - /// - /// The 2nd day of December of the current year - /// - public static DateTime The2nd - { - get { return new DateTime(DateTime.Now.Year, 12, 2); } - } - - /// - /// The 3rd day of December of the current year - /// - public static DateTime The3rd - { - get { return new DateTime(DateTime.Now.Year, 12, 3); } - } - - /// - /// The 4th day of December of the current year - /// - public static DateTime The4th - { - get { return new DateTime(DateTime.Now.Year, 12, 4); } - } - - /// - /// The 5th day of December of the current year - /// - public static DateTime The5th - { - get { return new DateTime(DateTime.Now.Year, 12, 5); } - } - - /// - /// The 6th day of December of the current year - /// - public static DateTime The6th - { - get { return new DateTime(DateTime.Now.Year, 12, 6); } - } - - /// - /// The 7th day of December of the current year - /// - public static DateTime The7th - { - get { return new DateTime(DateTime.Now.Year, 12, 7); } - } - - /// - /// The 8th day of December of the current year - /// - public static DateTime The8th - { - get { return new DateTime(DateTime.Now.Year, 12, 8); } - } - - /// - /// The 9th day of December of the current year - /// - public static DateTime The9th - { - get { return new DateTime(DateTime.Now.Year, 12, 9); } - } - - /// - /// The 10th day of December of the current year - /// - public static DateTime The10th - { - get { return new DateTime(DateTime.Now.Year, 12, 10); } - } - - /// - /// The 11th day of December of the current year - /// - public static DateTime The11th - { - get { return new DateTime(DateTime.Now.Year, 12, 11); } - } - - /// - /// The 12th day of December of the current year - /// - public static DateTime The12th - { - get { return new DateTime(DateTime.Now.Year, 12, 12); } - } - - /// - /// The 13th day of December of the current year - /// - public static DateTime The13th - { - get { return new DateTime(DateTime.Now.Year, 12, 13); } - } - - /// - /// The 14th day of December of the current year - /// - public static DateTime The14th - { - get { return new DateTime(DateTime.Now.Year, 12, 14); } - } - - /// - /// The 15th day of December of the current year - /// - public static DateTime The15th - { - get { return new DateTime(DateTime.Now.Year, 12, 15); } - } - - /// - /// The 16th day of December of the current year - /// - public static DateTime The16th - { - get { return new DateTime(DateTime.Now.Year, 12, 16); } - } - - /// - /// The 17th day of December of the current year - /// - public static DateTime The17th - { - get { return new DateTime(DateTime.Now.Year, 12, 17); } - } - - /// - /// The 18th day of December of the current year - /// - public static DateTime The18th - { - get { return new DateTime(DateTime.Now.Year, 12, 18); } - } - - /// - /// The 19th day of December of the current year - /// - public static DateTime The19th - { - get { return new DateTime(DateTime.Now.Year, 12, 19); } - } - - /// - /// The 20th day of December of the current year - /// - public static DateTime The20th - { - get { return new DateTime(DateTime.Now.Year, 12, 20); } - } - - /// - /// The 21st day of December of the current year - /// - public static DateTime The21st - { - get { return new DateTime(DateTime.Now.Year, 12, 21); } - } - - /// - /// The 22nd day of December of the current year - /// - public static DateTime The22nd - { - get { return new DateTime(DateTime.Now.Year, 12, 22); } - } - - /// - /// The 23rd day of December of the current year - /// - public static DateTime The23rd - { - get { return new DateTime(DateTime.Now.Year, 12, 23); } - } - - /// - /// The 24th day of December of the current year - /// - public static DateTime The24th - { - get { return new DateTime(DateTime.Now.Year, 12, 24); } - } - - /// - /// The 25th day of December of the current year - /// - public static DateTime The25th - { - get { return new DateTime(DateTime.Now.Year, 12, 25); } - } - - /// - /// The 26th day of December of the current year - /// - public static DateTime The26th - { - get { return new DateTime(DateTime.Now.Year, 12, 26); } - } - - /// - /// The 27th day of December of the current year - /// - public static DateTime The27th - { - get { return new DateTime(DateTime.Now.Year, 12, 27); } - } - - /// - /// The 28th day of December of the current year - /// - public static DateTime The28th - { - get { return new DateTime(DateTime.Now.Year, 12, 28); } - } - - /// - /// The 29th day of December of the current year - /// - public static DateTime The29th - { - get { return new DateTime(DateTime.Now.Year, 12, 29); } - } - - /// - /// The 30th day of December of the current year - /// - public static DateTime The30th - { - get { return new DateTime(DateTime.Now.Year, 12, 30); } - } - - /// - /// The 31st day of December of the current year - /// - public static DateTime The31st - { - get { return new DateTime(DateTime.Now.Year, 12, 31); } - } - } - } + public class December + { + /// + /// The nth day of December of the current year + /// + public static DateTime The(int dayNumber) + { + return new DateTime(DateTime.Now.Year, 12, dayNumber); + } + + /// + /// The 1st day of December of the current year + /// + public static DateTime The1st + { + get { return new DateTime(DateTime.Now.Year, 12, 1); } + } + + /// + /// The 2nd day of December of the current year + /// + public static DateTime The2nd + { + get { return new DateTime(DateTime.Now.Year, 12, 2); } + } + + /// + /// The 3rd day of December of the current year + /// + public static DateTime The3rd + { + get { return new DateTime(DateTime.Now.Year, 12, 3); } + } + + /// + /// The 4th day of December of the current year + /// + public static DateTime The4th + { + get { return new DateTime(DateTime.Now.Year, 12, 4); } + } + + /// + /// The 5th day of December of the current year + /// + public static DateTime The5th + { + get { return new DateTime(DateTime.Now.Year, 12, 5); } + } + + /// + /// The 6th day of December of the current year + /// + public static DateTime The6th + { + get { return new DateTime(DateTime.Now.Year, 12, 6); } + } + + /// + /// The 7th day of December of the current year + /// + public static DateTime The7th + { + get { return new DateTime(DateTime.Now.Year, 12, 7); } + } + + /// + /// The 8th day of December of the current year + /// + public static DateTime The8th + { + get { return new DateTime(DateTime.Now.Year, 12, 8); } + } + + /// + /// The 9th day of December of the current year + /// + public static DateTime The9th + { + get { return new DateTime(DateTime.Now.Year, 12, 9); } + } + + /// + /// The 10th day of December of the current year + /// + public static DateTime The10th + { + get { return new DateTime(DateTime.Now.Year, 12, 10); } + } + + /// + /// The 11th day of December of the current year + /// + public static DateTime The11th + { + get { return new DateTime(DateTime.Now.Year, 12, 11); } + } + + /// + /// The 12th day of December of the current year + /// + public static DateTime The12th + { + get { return new DateTime(DateTime.Now.Year, 12, 12); } + } + + /// + /// The 13th day of December of the current year + /// + public static DateTime The13th + { + get { return new DateTime(DateTime.Now.Year, 12, 13); } + } + + /// + /// The 14th day of December of the current year + /// + public static DateTime The14th + { + get { return new DateTime(DateTime.Now.Year, 12, 14); } + } + + /// + /// The 15th day of December of the current year + /// + public static DateTime The15th + { + get { return new DateTime(DateTime.Now.Year, 12, 15); } + } + + /// + /// The 16th day of December of the current year + /// + public static DateTime The16th + { + get { return new DateTime(DateTime.Now.Year, 12, 16); } + } + + /// + /// The 17th day of December of the current year + /// + public static DateTime The17th + { + get { return new DateTime(DateTime.Now.Year, 12, 17); } + } + + /// + /// The 18th day of December of the current year + /// + public static DateTime The18th + { + get { return new DateTime(DateTime.Now.Year, 12, 18); } + } + + /// + /// The 19th day of December of the current year + /// + public static DateTime The19th + { + get { return new DateTime(DateTime.Now.Year, 12, 19); } + } + + /// + /// The 20th day of December of the current year + /// + public static DateTime The20th + { + get { return new DateTime(DateTime.Now.Year, 12, 20); } + } + + /// + /// The 21st day of December of the current year + /// + public static DateTime The21st + { + get { return new DateTime(DateTime.Now.Year, 12, 21); } + } + + /// + /// The 22nd day of December of the current year + /// + public static DateTime The22nd + { + get { return new DateTime(DateTime.Now.Year, 12, 22); } + } + + /// + /// The 23rd day of December of the current year + /// + public static DateTime The23rd + { + get { return new DateTime(DateTime.Now.Year, 12, 23); } + } + + /// + /// The 24th day of December of the current year + /// + public static DateTime The24th + { + get { return new DateTime(DateTime.Now.Year, 12, 24); } + } + + /// + /// The 25th day of December of the current year + /// + public static DateTime The25th + { + get { return new DateTime(DateTime.Now.Year, 12, 25); } + } + + /// + /// The 26th day of December of the current year + /// + public static DateTime The26th + { + get { return new DateTime(DateTime.Now.Year, 12, 26); } + } + + /// + /// The 27th day of December of the current year + /// + public static DateTime The27th + { + get { return new DateTime(DateTime.Now.Year, 12, 27); } + } + + /// + /// The 28th day of December of the current year + /// + public static DateTime The28th + { + get { return new DateTime(DateTime.Now.Year, 12, 28); } + } + + /// + /// The 29th day of December of the current year + /// + public static DateTime The29th + { + get { return new DateTime(DateTime.Now.Year, 12, 29); } + } + + /// + /// The 30th day of December of the current year + /// + public static DateTime The30th + { + get { return new DateTime(DateTime.Now.Year, 12, 30); } + } + + /// + /// The 31st day of December of the current year + /// + public static DateTime The31st + { + get { return new DateTime(DateTime.Now.Year, 12, 31); } + } + } + } } \ No newline at end of file diff --git a/src/Humanizer/FluentDate/OnDate.Days.cs b/src/Humanizer/FluentDate/OnDate.Days.cs new file mode 100644 index 000000000..550d6db79 --- /dev/null +++ b/src/Humanizer/FluentDate/OnDate.Days.cs @@ -0,0 +1,3111 @@ + + +#if NET6_0_OR_GREATER +using System; + +namespace Humanizer +{ + /// + /// + public partial class OnDate + { + + /// + /// Provides fluent date accessors for January + /// + public class January + { + /// + /// The nth day of January of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 1, dayNumber); + } + + /// + /// The 1st day of January of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 1, 1); } + } + + /// + /// The 2nd day of January of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 1, 2); } + } + + /// + /// The 3rd day of January of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 1, 3); } + } + + /// + /// The 4th day of January of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 1, 4); } + } + + /// + /// The 5th day of January of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 1, 5); } + } + + /// + /// The 6th day of January of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 1, 6); } + } + + /// + /// The 7th day of January of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 1, 7); } + } + + /// + /// The 8th day of January of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 1, 8); } + } + + /// + /// The 9th day of January of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 1, 9); } + } + + /// + /// The 10th day of January of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 1, 10); } + } + + /// + /// The 11th day of January of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 1, 11); } + } + + /// + /// The 12th day of January of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 1, 12); } + } + + /// + /// The 13th day of January of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 1, 13); } + } + + /// + /// The 14th day of January of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 1, 14); } + } + + /// + /// The 15th day of January of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 1, 15); } + } + + /// + /// The 16th day of January of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 1, 16); } + } + + /// + /// The 17th day of January of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 1, 17); } + } + + /// + /// The 18th day of January of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 1, 18); } + } + + /// + /// The 19th day of January of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 1, 19); } + } + + /// + /// The 20th day of January of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 1, 20); } + } + + /// + /// The 21st day of January of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 1, 21); } + } + + /// + /// The 22nd day of January of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 1, 22); } + } + + /// + /// The 23rd day of January of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 1, 23); } + } + + /// + /// The 24th day of January of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 1, 24); } + } + + /// + /// The 25th day of January of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 1, 25); } + } + + /// + /// The 26th day of January of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 1, 26); } + } + + /// + /// The 27th day of January of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 1, 27); } + } + + /// + /// The 28th day of January of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 1, 28); } + } + + /// + /// The 29th day of January of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 1, 29); } + } + + /// + /// The 30th day of January of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 1, 30); } + } + + /// + /// The 31st day of January of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 1, 31); } + } + } + + /// + /// Provides fluent date accessors for February + /// + public class February + { + /// + /// The nth day of February of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 2, dayNumber); + } + + /// + /// The 1st day of February of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 2, 1); } + } + + /// + /// The 2nd day of February of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 2, 2); } + } + + /// + /// The 3rd day of February of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 2, 3); } + } + + /// + /// The 4th day of February of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 2, 4); } + } + + /// + /// The 5th day of February of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 2, 5); } + } + + /// + /// The 6th day of February of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 2, 6); } + } + + /// + /// The 7th day of February of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 2, 7); } + } + + /// + /// The 8th day of February of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 2, 8); } + } + + /// + /// The 9th day of February of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 2, 9); } + } + + /// + /// The 10th day of February of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 2, 10); } + } + + /// + /// The 11th day of February of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 2, 11); } + } + + /// + /// The 12th day of February of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 2, 12); } + } + + /// + /// The 13th day of February of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 2, 13); } + } + + /// + /// The 14th day of February of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 2, 14); } + } + + /// + /// The 15th day of February of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 2, 15); } + } + + /// + /// The 16th day of February of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 2, 16); } + } + + /// + /// The 17th day of February of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 2, 17); } + } + + /// + /// The 18th day of February of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 2, 18); } + } + + /// + /// The 19th day of February of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 2, 19); } + } + + /// + /// The 20th day of February of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 2, 20); } + } + + /// + /// The 21st day of February of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 2, 21); } + } + + /// + /// The 22nd day of February of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 2, 22); } + } + + /// + /// The 23rd day of February of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 2, 23); } + } + + /// + /// The 24th day of February of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 2, 24); } + } + + /// + /// The 25th day of February of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 2, 25); } + } + + /// + /// The 26th day of February of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 2, 26); } + } + + /// + /// The 27th day of February of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 2, 27); } + } + + /// + /// The 28th day of February of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 2, 28); } + } + + /// + /// The 29th day of February of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 2, 29); } + } + } + + /// + /// Provides fluent date accessors for March + /// + public class March + { + /// + /// The nth day of March of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 3, dayNumber); + } + + /// + /// The 1st day of March of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 3, 1); } + } + + /// + /// The 2nd day of March of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 3, 2); } + } + + /// + /// The 3rd day of March of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 3, 3); } + } + + /// + /// The 4th day of March of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 3, 4); } + } + + /// + /// The 5th day of March of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 3, 5); } + } + + /// + /// The 6th day of March of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 3, 6); } + } + + /// + /// The 7th day of March of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 3, 7); } + } + + /// + /// The 8th day of March of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 3, 8); } + } + + /// + /// The 9th day of March of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 3, 9); } + } + + /// + /// The 10th day of March of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 3, 10); } + } + + /// + /// The 11th day of March of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 3, 11); } + } + + /// + /// The 12th day of March of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 3, 12); } + } + + /// + /// The 13th day of March of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 3, 13); } + } + + /// + /// The 14th day of March of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 3, 14); } + } + + /// + /// The 15th day of March of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 3, 15); } + } + + /// + /// The 16th day of March of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 3, 16); } + } + + /// + /// The 17th day of March of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 3, 17); } + } + + /// + /// The 18th day of March of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 3, 18); } + } + + /// + /// The 19th day of March of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 3, 19); } + } + + /// + /// The 20th day of March of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 3, 20); } + } + + /// + /// The 21st day of March of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 3, 21); } + } + + /// + /// The 22nd day of March of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 3, 22); } + } + + /// + /// The 23rd day of March of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 3, 23); } + } + + /// + /// The 24th day of March of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 3, 24); } + } + + /// + /// The 25th day of March of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 3, 25); } + } + + /// + /// The 26th day of March of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 3, 26); } + } + + /// + /// The 27th day of March of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 3, 27); } + } + + /// + /// The 28th day of March of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 3, 28); } + } + + /// + /// The 29th day of March of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 3, 29); } + } + + /// + /// The 30th day of March of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 3, 30); } + } + + /// + /// The 31st day of March of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 3, 31); } + } + } + + /// + /// Provides fluent date accessors for April + /// + public class April + { + /// + /// The nth day of April of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 4, dayNumber); + } + + /// + /// The 1st day of April of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 4, 1); } + } + + /// + /// The 2nd day of April of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 4, 2); } + } + + /// + /// The 3rd day of April of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 4, 3); } + } + + /// + /// The 4th day of April of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 4, 4); } + } + + /// + /// The 5th day of April of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 4, 5); } + } + + /// + /// The 6th day of April of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 4, 6); } + } + + /// + /// The 7th day of April of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 4, 7); } + } + + /// + /// The 8th day of April of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 4, 8); } + } + + /// + /// The 9th day of April of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 4, 9); } + } + + /// + /// The 10th day of April of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 4, 10); } + } + + /// + /// The 11th day of April of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 4, 11); } + } + + /// + /// The 12th day of April of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 4, 12); } + } + + /// + /// The 13th day of April of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 4, 13); } + } + + /// + /// The 14th day of April of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 4, 14); } + } + + /// + /// The 15th day of April of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 4, 15); } + } + + /// + /// The 16th day of April of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 4, 16); } + } + + /// + /// The 17th day of April of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 4, 17); } + } + + /// + /// The 18th day of April of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 4, 18); } + } + + /// + /// The 19th day of April of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 4, 19); } + } + + /// + /// The 20th day of April of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 4, 20); } + } + + /// + /// The 21st day of April of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 4, 21); } + } + + /// + /// The 22nd day of April of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 4, 22); } + } + + /// + /// The 23rd day of April of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 4, 23); } + } + + /// + /// The 24th day of April of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 4, 24); } + } + + /// + /// The 25th day of April of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 4, 25); } + } + + /// + /// The 26th day of April of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 4, 26); } + } + + /// + /// The 27th day of April of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 4, 27); } + } + + /// + /// The 28th day of April of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 4, 28); } + } + + /// + /// The 29th day of April of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 4, 29); } + } + + /// + /// The 30th day of April of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 4, 30); } + } + } + + /// + /// Provides fluent date accessors for May + /// + public class May + { + /// + /// The nth day of May of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 5, dayNumber); + } + + /// + /// The 1st day of May of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 5, 1); } + } + + /// + /// The 2nd day of May of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 5, 2); } + } + + /// + /// The 3rd day of May of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 5, 3); } + } + + /// + /// The 4th day of May of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 5, 4); } + } + + /// + /// The 5th day of May of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 5, 5); } + } + + /// + /// The 6th day of May of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 5, 6); } + } + + /// + /// The 7th day of May of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 5, 7); } + } + + /// + /// The 8th day of May of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 5, 8); } + } + + /// + /// The 9th day of May of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 5, 9); } + } + + /// + /// The 10th day of May of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 5, 10); } + } + + /// + /// The 11th day of May of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 5, 11); } + } + + /// + /// The 12th day of May of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 5, 12); } + } + + /// + /// The 13th day of May of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 5, 13); } + } + + /// + /// The 14th day of May of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 5, 14); } + } + + /// + /// The 15th day of May of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 5, 15); } + } + + /// + /// The 16th day of May of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 5, 16); } + } + + /// + /// The 17th day of May of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 5, 17); } + } + + /// + /// The 18th day of May of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 5, 18); } + } + + /// + /// The 19th day of May of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 5, 19); } + } + + /// + /// The 20th day of May of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 5, 20); } + } + + /// + /// The 21st day of May of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 5, 21); } + } + + /// + /// The 22nd day of May of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 5, 22); } + } + + /// + /// The 23rd day of May of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 5, 23); } + } + + /// + /// The 24th day of May of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 5, 24); } + } + + /// + /// The 25th day of May of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 5, 25); } + } + + /// + /// The 26th day of May of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 5, 26); } + } + + /// + /// The 27th day of May of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 5, 27); } + } + + /// + /// The 28th day of May of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 5, 28); } + } + + /// + /// The 29th day of May of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 5, 29); } + } + + /// + /// The 30th day of May of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 5, 30); } + } + + /// + /// The 31st day of May of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 5, 31); } + } + } + + /// + /// Provides fluent date accessors for June + /// + public class June + { + /// + /// The nth day of June of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 6, dayNumber); + } + + /// + /// The 1st day of June of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 6, 1); } + } + + /// + /// The 2nd day of June of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 6, 2); } + } + + /// + /// The 3rd day of June of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 6, 3); } + } + + /// + /// The 4th day of June of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 6, 4); } + } + + /// + /// The 5th day of June of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 6, 5); } + } + + /// + /// The 6th day of June of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 6, 6); } + } + + /// + /// The 7th day of June of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 6, 7); } + } + + /// + /// The 8th day of June of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 6, 8); } + } + + /// + /// The 9th day of June of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 6, 9); } + } + + /// + /// The 10th day of June of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 6, 10); } + } + + /// + /// The 11th day of June of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 6, 11); } + } + + /// + /// The 12th day of June of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 6, 12); } + } + + /// + /// The 13th day of June of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 6, 13); } + } + + /// + /// The 14th day of June of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 6, 14); } + } + + /// + /// The 15th day of June of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 6, 15); } + } + + /// + /// The 16th day of June of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 6, 16); } + } + + /// + /// The 17th day of June of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 6, 17); } + } + + /// + /// The 18th day of June of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 6, 18); } + } + + /// + /// The 19th day of June of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 6, 19); } + } + + /// + /// The 20th day of June of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 6, 20); } + } + + /// + /// The 21st day of June of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 6, 21); } + } + + /// + /// The 22nd day of June of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 6, 22); } + } + + /// + /// The 23rd day of June of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 6, 23); } + } + + /// + /// The 24th day of June of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 6, 24); } + } + + /// + /// The 25th day of June of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 6, 25); } + } + + /// + /// The 26th day of June of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 6, 26); } + } + + /// + /// The 27th day of June of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 6, 27); } + } + + /// + /// The 28th day of June of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 6, 28); } + } + + /// + /// The 29th day of June of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 6, 29); } + } + + /// + /// The 30th day of June of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 6, 30); } + } + } + + /// + /// Provides fluent date accessors for July + /// + public class July + { + /// + /// The nth day of July of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 7, dayNumber); + } + + /// + /// The 1st day of July of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 7, 1); } + } + + /// + /// The 2nd day of July of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 7, 2); } + } + + /// + /// The 3rd day of July of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 7, 3); } + } + + /// + /// The 4th day of July of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 7, 4); } + } + + /// + /// The 5th day of July of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 7, 5); } + } + + /// + /// The 6th day of July of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 7, 6); } + } + + /// + /// The 7th day of July of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 7, 7); } + } + + /// + /// The 8th day of July of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 7, 8); } + } + + /// + /// The 9th day of July of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 7, 9); } + } + + /// + /// The 10th day of July of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 7, 10); } + } + + /// + /// The 11th day of July of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 7, 11); } + } + + /// + /// The 12th day of July of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 7, 12); } + } + + /// + /// The 13th day of July of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 7, 13); } + } + + /// + /// The 14th day of July of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 7, 14); } + } + + /// + /// The 15th day of July of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 7, 15); } + } + + /// + /// The 16th day of July of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 7, 16); } + } + + /// + /// The 17th day of July of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 7, 17); } + } + + /// + /// The 18th day of July of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 7, 18); } + } + + /// + /// The 19th day of July of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 7, 19); } + } + + /// + /// The 20th day of July of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 7, 20); } + } + + /// + /// The 21st day of July of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 7, 21); } + } + + /// + /// The 22nd day of July of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 7, 22); } + } + + /// + /// The 23rd day of July of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 7, 23); } + } + + /// + /// The 24th day of July of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 7, 24); } + } + + /// + /// The 25th day of July of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 7, 25); } + } + + /// + /// The 26th day of July of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 7, 26); } + } + + /// + /// The 27th day of July of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 7, 27); } + } + + /// + /// The 28th day of July of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 7, 28); } + } + + /// + /// The 29th day of July of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 7, 29); } + } + + /// + /// The 30th day of July of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 7, 30); } + } + + /// + /// The 31st day of July of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 7, 31); } + } + } + + /// + /// Provides fluent date accessors for August + /// + public class August + { + /// + /// The nth day of August of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 8, dayNumber); + } + + /// + /// The 1st day of August of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 8, 1); } + } + + /// + /// The 2nd day of August of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 8, 2); } + } + + /// + /// The 3rd day of August of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 8, 3); } + } + + /// + /// The 4th day of August of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 8, 4); } + } + + /// + /// The 5th day of August of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 8, 5); } + } + + /// + /// The 6th day of August of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 8, 6); } + } + + /// + /// The 7th day of August of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 8, 7); } + } + + /// + /// The 8th day of August of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 8, 8); } + } + + /// + /// The 9th day of August of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 8, 9); } + } + + /// + /// The 10th day of August of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 8, 10); } + } + + /// + /// The 11th day of August of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 8, 11); } + } + + /// + /// The 12th day of August of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 8, 12); } + } + + /// + /// The 13th day of August of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 8, 13); } + } + + /// + /// The 14th day of August of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 8, 14); } + } + + /// + /// The 15th day of August of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 8, 15); } + } + + /// + /// The 16th day of August of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 8, 16); } + } + + /// + /// The 17th day of August of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 8, 17); } + } + + /// + /// The 18th day of August of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 8, 18); } + } + + /// + /// The 19th day of August of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 8, 19); } + } + + /// + /// The 20th day of August of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 8, 20); } + } + + /// + /// The 21st day of August of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 8, 21); } + } + + /// + /// The 22nd day of August of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 8, 22); } + } + + /// + /// The 23rd day of August of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 8, 23); } + } + + /// + /// The 24th day of August of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 8, 24); } + } + + /// + /// The 25th day of August of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 8, 25); } + } + + /// + /// The 26th day of August of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 8, 26); } + } + + /// + /// The 27th day of August of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 8, 27); } + } + + /// + /// The 28th day of August of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 8, 28); } + } + + /// + /// The 29th day of August of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 8, 29); } + } + + /// + /// The 30th day of August of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 8, 30); } + } + + /// + /// The 31st day of August of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 8, 31); } + } + } + + /// + /// Provides fluent date accessors for September + /// + public class September + { + /// + /// The nth day of September of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 9, dayNumber); + } + + /// + /// The 1st day of September of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 9, 1); } + } + + /// + /// The 2nd day of September of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 9, 2); } + } + + /// + /// The 3rd day of September of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 9, 3); } + } + + /// + /// The 4th day of September of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 9, 4); } + } + + /// + /// The 5th day of September of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 9, 5); } + } + + /// + /// The 6th day of September of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 9, 6); } + } + + /// + /// The 7th day of September of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 9, 7); } + } + + /// + /// The 8th day of September of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 9, 8); } + } + + /// + /// The 9th day of September of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 9, 9); } + } + + /// + /// The 10th day of September of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 9, 10); } + } + + /// + /// The 11th day of September of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 9, 11); } + } + + /// + /// The 12th day of September of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 9, 12); } + } + + /// + /// The 13th day of September of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 9, 13); } + } + + /// + /// The 14th day of September of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 9, 14); } + } + + /// + /// The 15th day of September of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 9, 15); } + } + + /// + /// The 16th day of September of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 9, 16); } + } + + /// + /// The 17th day of September of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 9, 17); } + } + + /// + /// The 18th day of September of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 9, 18); } + } + + /// + /// The 19th day of September of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 9, 19); } + } + + /// + /// The 20th day of September of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 9, 20); } + } + + /// + /// The 21st day of September of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 9, 21); } + } + + /// + /// The 22nd day of September of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 9, 22); } + } + + /// + /// The 23rd day of September of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 9, 23); } + } + + /// + /// The 24th day of September of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 9, 24); } + } + + /// + /// The 25th day of September of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 9, 25); } + } + + /// + /// The 26th day of September of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 9, 26); } + } + + /// + /// The 27th day of September of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 9, 27); } + } + + /// + /// The 28th day of September of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 9, 28); } + } + + /// + /// The 29th day of September of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 9, 29); } + } + + /// + /// The 30th day of September of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 9, 30); } + } + } + + /// + /// Provides fluent date accessors for October + /// + public class October + { + /// + /// The nth day of October of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 10, dayNumber); + } + + /// + /// The 1st day of October of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 10, 1); } + } + + /// + /// The 2nd day of October of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 10, 2); } + } + + /// + /// The 3rd day of October of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 10, 3); } + } + + /// + /// The 4th day of October of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 10, 4); } + } + + /// + /// The 5th day of October of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 10, 5); } + } + + /// + /// The 6th day of October of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 10, 6); } + } + + /// + /// The 7th day of October of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 10, 7); } + } + + /// + /// The 8th day of October of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 10, 8); } + } + + /// + /// The 9th day of October of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 10, 9); } + } + + /// + /// The 10th day of October of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 10, 10); } + } + + /// + /// The 11th day of October of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 10, 11); } + } + + /// + /// The 12th day of October of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 10, 12); } + } + + /// + /// The 13th day of October of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 10, 13); } + } + + /// + /// The 14th day of October of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 10, 14); } + } + + /// + /// The 15th day of October of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 10, 15); } + } + + /// + /// The 16th day of October of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 10, 16); } + } + + /// + /// The 17th day of October of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 10, 17); } + } + + /// + /// The 18th day of October of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 10, 18); } + } + + /// + /// The 19th day of October of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 10, 19); } + } + + /// + /// The 20th day of October of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 10, 20); } + } + + /// + /// The 21st day of October of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 10, 21); } + } + + /// + /// The 22nd day of October of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 10, 22); } + } + + /// + /// The 23rd day of October of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 10, 23); } + } + + /// + /// The 24th day of October of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 10, 24); } + } + + /// + /// The 25th day of October of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 10, 25); } + } + + /// + /// The 26th day of October of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 10, 26); } + } + + /// + /// The 27th day of October of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 10, 27); } + } + + /// + /// The 28th day of October of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 10, 28); } + } + + /// + /// The 29th day of October of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 10, 29); } + } + + /// + /// The 30th day of October of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 10, 30); } + } + + /// + /// The 31st day of October of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 10, 31); } + } + } + + /// + /// Provides fluent date accessors for November + /// + public class November + { + /// + /// The nth day of November of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 11, dayNumber); + } + + /// + /// The 1st day of November of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 11, 1); } + } + + /// + /// The 2nd day of November of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 11, 2); } + } + + /// + /// The 3rd day of November of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 11, 3); } + } + + /// + /// The 4th day of November of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 11, 4); } + } + + /// + /// The 5th day of November of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 11, 5); } + } + + /// + /// The 6th day of November of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 11, 6); } + } + + /// + /// The 7th day of November of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 11, 7); } + } + + /// + /// The 8th day of November of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 11, 8); } + } + + /// + /// The 9th day of November of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 11, 9); } + } + + /// + /// The 10th day of November of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 11, 10); } + } + + /// + /// The 11th day of November of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 11, 11); } + } + + /// + /// The 12th day of November of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 11, 12); } + } + + /// + /// The 13th day of November of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 11, 13); } + } + + /// + /// The 14th day of November of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 11, 14); } + } + + /// + /// The 15th day of November of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 11, 15); } + } + + /// + /// The 16th day of November of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 11, 16); } + } + + /// + /// The 17th day of November of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 11, 17); } + } + + /// + /// The 18th day of November of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 11, 18); } + } + + /// + /// The 19th day of November of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 11, 19); } + } + + /// + /// The 20th day of November of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 11, 20); } + } + + /// + /// The 21st day of November of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 11, 21); } + } + + /// + /// The 22nd day of November of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 11, 22); } + } + + /// + /// The 23rd day of November of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 11, 23); } + } + + /// + /// The 24th day of November of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 11, 24); } + } + + /// + /// The 25th day of November of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 11, 25); } + } + + /// + /// The 26th day of November of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 11, 26); } + } + + /// + /// The 27th day of November of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 11, 27); } + } + + /// + /// The 28th day of November of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 11, 28); } + } + + /// + /// The 29th day of November of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 11, 29); } + } + + /// + /// The 30th day of November of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 11, 30); } + } + } + + /// + /// Provides fluent date accessors for December + /// + public class December + { + /// + /// The nth day of December of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, 12, dayNumber); + } + + /// + /// The 1st day of December of the current year + /// + public static DateOnly The1st + { + get { return new DateOnly(DateTime.Now.Year, 12, 1); } + } + + /// + /// The 2nd day of December of the current year + /// + public static DateOnly The2nd + { + get { return new DateOnly(DateTime.Now.Year, 12, 2); } + } + + /// + /// The 3rd day of December of the current year + /// + public static DateOnly The3rd + { + get { return new DateOnly(DateTime.Now.Year, 12, 3); } + } + + /// + /// The 4th day of December of the current year + /// + public static DateOnly The4th + { + get { return new DateOnly(DateTime.Now.Year, 12, 4); } + } + + /// + /// The 5th day of December of the current year + /// + public static DateOnly The5th + { + get { return new DateOnly(DateTime.Now.Year, 12, 5); } + } + + /// + /// The 6th day of December of the current year + /// + public static DateOnly The6th + { + get { return new DateOnly(DateTime.Now.Year, 12, 6); } + } + + /// + /// The 7th day of December of the current year + /// + public static DateOnly The7th + { + get { return new DateOnly(DateTime.Now.Year, 12, 7); } + } + + /// + /// The 8th day of December of the current year + /// + public static DateOnly The8th + { + get { return new DateOnly(DateTime.Now.Year, 12, 8); } + } + + /// + /// The 9th day of December of the current year + /// + public static DateOnly The9th + { + get { return new DateOnly(DateTime.Now.Year, 12, 9); } + } + + /// + /// The 10th day of December of the current year + /// + public static DateOnly The10th + { + get { return new DateOnly(DateTime.Now.Year, 12, 10); } + } + + /// + /// The 11th day of December of the current year + /// + public static DateOnly The11th + { + get { return new DateOnly(DateTime.Now.Year, 12, 11); } + } + + /// + /// The 12th day of December of the current year + /// + public static DateOnly The12th + { + get { return new DateOnly(DateTime.Now.Year, 12, 12); } + } + + /// + /// The 13th day of December of the current year + /// + public static DateOnly The13th + { + get { return new DateOnly(DateTime.Now.Year, 12, 13); } + } + + /// + /// The 14th day of December of the current year + /// + public static DateOnly The14th + { + get { return new DateOnly(DateTime.Now.Year, 12, 14); } + } + + /// + /// The 15th day of December of the current year + /// + public static DateOnly The15th + { + get { return new DateOnly(DateTime.Now.Year, 12, 15); } + } + + /// + /// The 16th day of December of the current year + /// + public static DateOnly The16th + { + get { return new DateOnly(DateTime.Now.Year, 12, 16); } + } + + /// + /// The 17th day of December of the current year + /// + public static DateOnly The17th + { + get { return new DateOnly(DateTime.Now.Year, 12, 17); } + } + + /// + /// The 18th day of December of the current year + /// + public static DateOnly The18th + { + get { return new DateOnly(DateTime.Now.Year, 12, 18); } + } + + /// + /// The 19th day of December of the current year + /// + public static DateOnly The19th + { + get { return new DateOnly(DateTime.Now.Year, 12, 19); } + } + + /// + /// The 20th day of December of the current year + /// + public static DateOnly The20th + { + get { return new DateOnly(DateTime.Now.Year, 12, 20); } + } + + /// + /// The 21st day of December of the current year + /// + public static DateOnly The21st + { + get { return new DateOnly(DateTime.Now.Year, 12, 21); } + } + + /// + /// The 22nd day of December of the current year + /// + public static DateOnly The22nd + { + get { return new DateOnly(DateTime.Now.Year, 12, 22); } + } + + /// + /// The 23rd day of December of the current year + /// + public static DateOnly The23rd + { + get { return new DateOnly(DateTime.Now.Year, 12, 23); } + } + + /// + /// The 24th day of December of the current year + /// + public static DateOnly The24th + { + get { return new DateOnly(DateTime.Now.Year, 12, 24); } + } + + /// + /// The 25th day of December of the current year + /// + public static DateOnly The25th + { + get { return new DateOnly(DateTime.Now.Year, 12, 25); } + } + + /// + /// The 26th day of December of the current year + /// + public static DateOnly The26th + { + get { return new DateOnly(DateTime.Now.Year, 12, 26); } + } + + /// + /// The 27th day of December of the current year + /// + public static DateOnly The27th + { + get { return new DateOnly(DateTime.Now.Year, 12, 27); } + } + + /// + /// The 28th day of December of the current year + /// + public static DateOnly The28th + { + get { return new DateOnly(DateTime.Now.Year, 12, 28); } + } + + /// + /// The 29th day of December of the current year + /// + public static DateOnly The29th + { + get { return new DateOnly(DateTime.Now.Year, 12, 29); } + } + + /// + /// The 30th day of December of the current year + /// + public static DateOnly The30th + { + get { return new DateOnly(DateTime.Now.Year, 12, 30); } + } + + /// + /// The 31st day of December of the current year + /// + public static DateOnly The31st + { + get { return new DateOnly(DateTime.Now.Year, 12, 31); } + } + } + } +} + +#endif \ No newline at end of file diff --git a/src/Humanizer/FluentDate/OnDate.Days.tt b/src/Humanizer/FluentDate/OnDate.Days.tt new file mode 100644 index 000000000..22619e3e3 --- /dev/null +++ b/src/Humanizer/FluentDate/OnDate.Days.tt @@ -0,0 +1,59 @@ +<#@ template debug="true" hostSpecific="true" #> +<#@ output extension=".cs" #> +<#@ Assembly Name="System.Core" #> +<#@ Assembly Name="System.Windows.Forms" #> +<#@ assembly name="$(TargetPath)" #> +<#@ import namespace="System" #> +<#@ import namespace="Humanizer" #> +<#@ import namespace="System.IO" #> +<#@ import namespace="System.Diagnostics" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Collections" #> +<#@ import namespace="System.Collections.Generic" #> + +#if NET6_0_OR_GREATER +using System; + +namespace Humanizer +{ + /// + /// + public partial class OnDate + { + <# + const int leapYear = 2012; + for (int month = 1; month <= 12; month++) + { + var firstDayOfMonth = new DateTime(leapYear, month, 1); + var monthName = firstDayOfMonth.ToString("MMMM");#> + + /// + /// Provides fluent date accessors for <#= monthName #> + /// + public class <#= monthName #> + { + /// + /// The nth day of <#= monthName #> of the current year + /// + public static DateOnly The(int dayNumber) + { + return new DateOnly(DateTime.Now.Year, <#= month #>, dayNumber); + } + <#for (int day = 1; day <= DateTime.DaysInMonth(leapYear, month); day++) + { + var ordinalDay = day.Ordinalize();#> + + /// + /// The <#= ordinalDay #> day of <#= monthName #> of the current year + /// + public static DateOnly The<#= ordinalDay #> + { + get { return new DateOnly(DateTime.Now.Year, <#= month #>, <#= day #>); } + } + <#}#> +} + <#}#> + } +} + +#endif \ No newline at end of file diff --git a/src/Humanizer/Humanizer.csproj b/src/Humanizer/Humanizer.csproj index e7c110359..5b2f8ad9d 100644 --- a/src/Humanizer/Humanizer.csproj +++ b/src/Humanizer/Humanizer.csproj @@ -1,6 +1,6 @@  - net6.0;netstandard1.0;netstandard2.0 + netstandard1.0;netstandard2.0;net6.0 Mehdi Khalili, Claire Novotny https://raw.githubusercontent.com/Humanizr/Humanizer/master/LICENSE https://github.com/Humanizr/Humanizer @@ -13,5 +13,32 @@ Humanizer.snk embedded preview - + + + + InDate.Months.cs + TextTemplatingFileGenerator + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b2491d8f699189776a91450afc4e2b2d5c082d97 Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Mon, 7 Jun 2021 13:28:16 -0400 Subject: [PATCH 9/9] Add support for DateOnly to ordinal words --- .../de/DateToOrdinalWordsTests.cs | 8 ++++++ .../en/DateToOrdinalWordsTests.cs | 16 +++++++++++ ...provalTest.approve_public_api.approved.txt | 8 ++++++ src/Humanizer/Configuration/Configurator.cs | 24 ++++++++++++++++ ...DateOnlyToOrdinalWordsConverterRegistry.cs | 16 +++++++++++ src/Humanizer/DateHumanizeExtensions.cs | 4 +-- src/Humanizer/DateToOrdinalWordsExtensions.cs | 24 +++++++++++++++- .../DefaultDateOnlyToOrdinalWordConverter.cs | 23 +++++++++++++++ .../IDateOnlyToOrdinalWordConverter.cs | 28 +++++++++++++++++++ .../UsDateOnlyToOrdinalWordsConverter.cs | 14 ++++++++++ 10 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 src/Humanizer/Configuration/DateOnlyToOrdinalWordsConverterRegistry.cs create mode 100644 src/Humanizer/Localisation/DateToOrdinalWords/DefaultDateOnlyToOrdinalWordConverter.cs create mode 100644 src/Humanizer/Localisation/DateToOrdinalWords/IDateOnlyToOrdinalWordConverter.cs create mode 100644 src/Humanizer/Localisation/DateToOrdinalWords/UsDateOnlyToOrdinalWordsConverter.cs diff --git a/src/Humanizer.Tests.Shared/Localisation/de/DateToOrdinalWordsTests.cs b/src/Humanizer.Tests.Shared/Localisation/de/DateToOrdinalWordsTests.cs index 48ed80e1c..2e2ce5370 100644 --- a/src/Humanizer.Tests.Shared/Localisation/de/DateToOrdinalWordsTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/de/DateToOrdinalWordsTests.cs @@ -11,5 +11,13 @@ public void OrdinalizeString() { Assert.Equal("1. Januar 2015", new DateTime(2015, 1, 1).ToOrdinalWords()); } + +#if NET6_0_OR_GREATER + [Fact] + public void OrdinalizeDateOnlyString() + { + Assert.Equal("1. Januar 2015", new DateOnly(2015, 1, 1).ToOrdinalWords()); + } +#endif } } diff --git a/src/Humanizer.Tests.Shared/Localisation/en/DateToOrdinalWordsTests.cs b/src/Humanizer.Tests.Shared/Localisation/en/DateToOrdinalWordsTests.cs index e1f8eb92a..0ed0b4b99 100644 --- a/src/Humanizer.Tests.Shared/Localisation/en/DateToOrdinalWordsTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/en/DateToOrdinalWordsTests.cs @@ -18,5 +18,21 @@ public void OrdinalizeStringUs() { Assert.Equal("January 1st, 2015", new DateTime(2015, 1, 1).ToOrdinalWords()); } + +#if NET6_0_OR_GREATER + [UseCulture("en-GB")] + [Fact] + public void OrdinalizeDateOnlyStringGb() + { + Assert.Equal("1st January 2015", new DateOnly(2015, 1, 1).ToOrdinalWords()); + } + + [UseCulture("en-US")] + [Fact] + public void OrdinalizeDateOnlyStringUs() + { + Assert.Equal("January 1st, 2015", new DateOnly(2015, 1, 1).ToOrdinalWords()); + } +#endif } } diff --git a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt index 354294c69..2a2dc31ec 100644 --- a/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt +++ b/src/Humanizer.Tests/ApiApprover/PublicApiApprovalTest.approve_public_api.approved.txt @@ -84,6 +84,8 @@ namespace Humanizer { public static string ToOrdinalWords(this System.DateTime input) { } public static string ToOrdinalWords(this System.DateTime input, Humanizer.GrammaticalCase grammaticalCase) { } + public static string ToOrdinalWords(this System.DateOnly input) { } + public static string ToOrdinalWords(this System.DateOnly input, Humanizer.GrammaticalCase grammaticalCase) { } } public class static EnglishArticle { @@ -1717,6 +1719,7 @@ namespace Humanizer.Configuration { public static Humanizer.Configuration.LocaliserRegistry CollectionFormatters { get; } public static Humanizer.DateTimeHumanizeStrategy.IDateOnlyHumanizeStrategy DateOnlyHumanizeStrategy { get; set; } + public static Humanizer.Configuration.LocaliserRegistry DateOnlyToOrdinalWordsConverters { get; } public static Humanizer.DateTimeHumanizeStrategy.IDateTimeHumanizeStrategy DateTimeHumanizeStrategy { get; set; } public static Humanizer.DateTimeHumanizeStrategy.IDateTimeOffsetHumanizeStrategy DateTimeOffsetHumanizeStrategy { get; set; } public static Humanizer.Configuration.LocaliserRegistry DateToOrdinalWordsConverters { get; } @@ -1872,6 +1875,11 @@ namespace Humanizer.Localisation } namespace Humanizer.Localisation.DateToOrdinalWords { + public interface IDateOnlyToOrdinalWordConverter + { + string Convert(System.DateOnly date); + string Convert(System.DateOnly date, Humanizer.GrammaticalCase grammaticalCase); + } public interface IDateToOrdinalWordConverter { string Convert(System.DateTime date); diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index 0e52bddc6..f9e5dcbae 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -61,6 +61,17 @@ public static LocaliserRegistry DateToOrdinalWordsC get { return _dateToOrdinalWordConverters; } } +#if NET6_0_OR_GREATER + private static readonly LocaliserRegistry _dateOnlyToOrdinalWordConverters = new DateOnlyToOrdinalWordsConverterRegistry(); + /// + /// A registry of ordinalizers used to localise Ordinalize method + /// + public static LocaliserRegistry DateOnlyToOrdinalWordsConverters + { + get { return _dateOnlyToOrdinalWordConverters; } + } +#endif + internal static ICollectionFormatter CollectionFormatter { get @@ -109,6 +120,19 @@ internal static IDateToOrdinalWordConverter DateToOrdinalWordsConverter } } +#if NET6_0_OR_GREATER + /// + /// The ordinalizer to be used + /// + internal static IDateOnlyToOrdinalWordConverter DateOnlyToOrdinalWordsConverter + { + get + { + return DateOnlyToOrdinalWordsConverters.ResolveForUiCulture(); + } + } +#endif + private static IDateTimeHumanizeStrategy _dateTimeHumanizeStrategy = new DefaultDateTimeHumanizeStrategy(); /// /// The strategy to be used for DateTime.Humanize diff --git a/src/Humanizer/Configuration/DateOnlyToOrdinalWordsConverterRegistry.cs b/src/Humanizer/Configuration/DateOnlyToOrdinalWordsConverterRegistry.cs new file mode 100644 index 000000000..89cdbbe45 --- /dev/null +++ b/src/Humanizer/Configuration/DateOnlyToOrdinalWordsConverterRegistry.cs @@ -0,0 +1,16 @@ +#if NET6_0_OR_GREATER + +using Humanizer.Localisation.DateToOrdinalWords; +namespace Humanizer.Configuration +{ + internal class DateOnlyToOrdinalWordsConverterRegistry : LocaliserRegistry + { + public DateOnlyToOrdinalWordsConverterRegistry() : base(new DefaultDateOnlyToOrdinalWordConverter()) + { + Register("en-UK", new DefaultDateOnlyToOrdinalWordConverter()); + Register("de", new DefaultDateOnlyToOrdinalWordConverter()); + Register("en-US", new UsDateOnlyToOrdinalWordsConverter()); + } + } +} +#endif diff --git a/src/Humanizer/DateHumanizeExtensions.cs b/src/Humanizer/DateHumanizeExtensions.cs index 025dd7c88..e1d4bd5fa 100644 --- a/src/Humanizer/DateHumanizeExtensions.cs +++ b/src/Humanizer/DateHumanizeExtensions.cs @@ -117,7 +117,7 @@ public static string Humanize(this DateOnly? input, DateOnly? dateToCompareAgain /// Turns the current or provided time into a human readable sentence /// /// The date to be humanized - /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. + /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. /// Date to compare the input against. If null, current date is used as base /// Culture to use. If null, current thread's UI culture is used. /// distance of time in words @@ -132,7 +132,7 @@ public static string Humanize(this TimeOnly input, TimeOnly? timeToCompareAgains /// Turns the current or provided time into a human readable sentence, overload for the nullable TimeOnly, returning 'never' in case null /// /// The date to be humanized - /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. + /// If is null, used to determine if the current time is UTC or local. Defaults to UTC. /// Time to compare the input against. If null, current date is used as base /// Culture to use. If null, current thread's UI culture is used. /// distance of time in words diff --git a/src/Humanizer/DateToOrdinalWordsExtensions.cs b/src/Humanizer/DateToOrdinalWordsExtensions.cs index afb297389..9d6b1ba5c 100644 --- a/src/Humanizer/DateToOrdinalWordsExtensions.cs +++ b/src/Humanizer/DateToOrdinalWordsExtensions.cs @@ -27,5 +27,27 @@ public static string ToOrdinalWords(this DateTime input, GrammaticalCase grammat { return Configurator.DateToOrdinalWordsConverter.Convert(input, grammaticalCase); } + +#if NET6_0_OR_GREATER + /// + /// Turns the provided date into ordinal words + /// + /// The date to be made into ordinal words + /// The date in ordinal words + public static string ToOrdinalWords(this DateOnly input) + { + return Configurator.DateOnlyToOrdinalWordsConverter.Convert(input); + } + /// + /// Turns the provided date into ordinal words + /// + /// The date to be made into ordinal words + /// The grammatical case to use for output words + /// The date in ordinal words + public static string ToOrdinalWords(this DateOnly input, GrammaticalCase grammaticalCase) + { + return Configurator.DateOnlyToOrdinalWordsConverter.Convert(input, grammaticalCase); + } +#endif } -} \ No newline at end of file +} diff --git a/src/Humanizer/Localisation/DateToOrdinalWords/DefaultDateOnlyToOrdinalWordConverter.cs b/src/Humanizer/Localisation/DateToOrdinalWords/DefaultDateOnlyToOrdinalWordConverter.cs new file mode 100644 index 000000000..73aa05cdc --- /dev/null +++ b/src/Humanizer/Localisation/DateToOrdinalWords/DefaultDateOnlyToOrdinalWordConverter.cs @@ -0,0 +1,23 @@ +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer.Localisation.DateToOrdinalWords +{ + internal class DefaultDateOnlyToOrdinalWordConverter : IDateOnlyToOrdinalWordConverter + { + + public virtual string Convert(DateOnly date) + { + return date.Day.Ordinalize() + date.ToString(" MMMM yyyy"); + } + + public virtual string Convert(DateOnly date, GrammaticalCase grammaticalCase) + { + return Convert(date); + } + + } +} + +#endif diff --git a/src/Humanizer/Localisation/DateToOrdinalWords/IDateOnlyToOrdinalWordConverter.cs b/src/Humanizer/Localisation/DateToOrdinalWords/IDateOnlyToOrdinalWordConverter.cs new file mode 100644 index 000000000..a2b92f93a --- /dev/null +++ b/src/Humanizer/Localisation/DateToOrdinalWords/IDateOnlyToOrdinalWordConverter.cs @@ -0,0 +1,28 @@ +#if NET6_0_OR_GREATER + +using System; + +namespace Humanizer.Localisation.DateToOrdinalWords +{ + /// + /// The interface used to localise the ToOrdinalWords method. + /// + public interface IDateOnlyToOrdinalWordConverter + { + /// + /// Converts the date to Ordinal Words + /// + /// + /// + string Convert(DateOnly date); + + /// + /// Converts the date to Ordinal Words using the provided grammatical case + /// + /// + /// + /// + string Convert(DateOnly date, GrammaticalCase grammaticalCase); + } +} +#endif diff --git a/src/Humanizer/Localisation/DateToOrdinalWords/UsDateOnlyToOrdinalWordsConverter.cs b/src/Humanizer/Localisation/DateToOrdinalWords/UsDateOnlyToOrdinalWordsConverter.cs new file mode 100644 index 000000000..9afa4abd3 --- /dev/null +++ b/src/Humanizer/Localisation/DateToOrdinalWords/UsDateOnlyToOrdinalWordsConverter.cs @@ -0,0 +1,14 @@ +#if NET6_0_OR_GREATER +using System; + +namespace Humanizer.Localisation.DateToOrdinalWords +{ + internal class UsDateOnlyToOrdinalWordsConverter : DefaultDateOnlyToOrdinalWordConverter + { + public override string Convert(DateOnly date) + { + return date.ToString("MMMM ") + date.Day.Ordinalize() + date.ToString(", yyyy"); + } + } +} +#endif