MmsCore.Calendar 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package MmsCore.Calendar --version 0.1.3                
NuGet\Install-Package MmsCore.Calendar -Version 0.1.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MmsCore.Calendar" Version="0.1.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MmsCore.Calendar --version 0.1.3                
#r "nuget: MmsCore.Calendar, 0.1.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MmsCore.Calendar as a Cake Addin
#addin nuget:?package=MmsCore.Calendar&version=0.1.3

// Install MmsCore.Calendar as a Cake Tool
#tool nuget:?package=MmsCore.Calendar&version=0.1.3                

[!IMPORTANT] This Project is not yet stable. Breaking changes may occur at any time.

MmsCore.Calendar

NuGet Version MmsCore.Calendar NuGet Package Downloads TFM TFM TFM

MmsCore.Calendarは、祝日や特定日を除外したビジネスカレンダーを提供します。MmsCore.Calendarでは、平日や土日を除外する機能、特定の除外日を追加する機能、翌営業日や前営業日を取得する機能、指定した期間内の営業日数を計算する機能、指定した営業日数後の日付を取得する機能などを提供しています。これにより、ユーザーはビジネスニーズに応じてカレンダーをカスタマイズすることができます。

🚀 Getting Started

AddBusinessDays

AddBusinessDays を使用して週末を除いた営業日を加算する方法の例です。

var calendar = new BusinessCalendar(excludeWeekends: true);

var startDate = new DateOnly(2023, 4, 10); // Monday
var resultDate = calendar.AddBusinessDays(startDate, 5);

Assert.Equal(new DateOnly(2023, 4, 17), resultDate);

AddBusinessDays (for subtraction)

AddBusinessDays を使用して週末を除いた営業日を減算する方法の例です。

var calendar = new BusinessCalendar(excludeWeekends: true);

var startDate = new DateOnly(2023, 4, 10); // Monday
var resultDate = calendar.AddBusinessDays(startDate, -3); // Subtract 3 business days

Assert.Equal(new DateOnly(2023, 4, 5), resultDate);

GetNextBusinessDay

GetNextBusinessDay を使用して、週末を除いた次の営業日を取得する方法の例です。

var calendar = new BusinessCalendar(excludeWeekends: true);

var startDate = new DateOnly(2023, 4, 7); // Friday
var resultDate = calendar.GetNextBusinessDay(startDate); // Skip Saturday and Sunday

Assert.Equal(new DateOnly(2023, 4, 10), resultDate);

GetPreviousBusinessDay

GetPreviousBusinessDay を使用して、週末を除いた前の営業日を取得する方法の例です。

var calendar = new BusinessCalendar(excludeWeekends: true);

var givenDate = new DateOnly(2023, 4, 10); // Monday
var resultDate = calendar.GetPreviousBusinessDay(givenDate);

Assert.Equal(new DateOnly(2023, 4, 7), resultDate);

AddExcludedDate

特定の日付を除外するために AddExcludedDay を使用する方法の例です。

var calendar = new BusinessCalendar();
calendar.ExcludeWeekends(); // Exclude weekends.

var startDate = new DateOnly(2023, 4, 1); // Saturday
var excludedDate = new DateOnly(2023, 4, 3); // Monday

calendar.AddExcludedDay(excludedDate); // Exclude specific date.
var resultDate = calendar.AddBusinessDays(startDay, 1); // Skip Sunday and Monday

Assert.Equal(new DateOnly(2023, 4, 4), result);

CalculateBusinessDays

開始日と終了日を含む、2つの日付間の営業日数を計算するために CalculateBusinessDays を使用する方法の例です。

var calendar = new BusinessCalendar();
calendar.ExcludeWeekends(); // Exclude weekends.

var startDate = new DateOnly(2023, 4, 10); // Monday
var endDate = new DateOnly(2023, 4, 17); // Monday
var businessDays = calendar.CalculateBusinessDays(startDate, endDate, includeStartDate: true, includeEndDate: true);

Assert.Equal(7, businessDays); // Expected result: Monday, Tuesday, Wednesday, Thursday, Friday, Monday, Monday

🙏 Acknowledgments

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.4 246 5/5/2024
0.1.3 122 2/29/2024
0.1.2 107 2/19/2024
0.1.1 103 2/11/2024
0.1.0 101 2/11/2024
0.0.1-beta.5 82 1/21/2024
0.0.1-beta.4 90 1/12/2024
0.0.1-beta.3 82 1/12/2024
0.0.1-beta.2 90 1/10/2024