Table of Contents

NotableDateFiscalExtensions Class

Definition

Namespace
Bodu.Extensions
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
NotableDateFiscalExtensions.FirstWorkingDayOfFiscalQuarter.cs

Provides fiscal-period working-day extension methods over DateOnly, resolving the boundary working days of the fiscal year or quarter that contains a date.

public static class NotableDateFiscalExtensions
Inheritance
NotableDateFiscalExtensions
Inherited Members

Examples

INotableDateService service = AmericasCalendarData.CreateService("US");
DateOnly anyDay = new(2026, 9, 15);

// United States federal fiscal year begins 1 October.
DateOnly fyOpen = anyDay.FirstWorkingDayOfFiscalYear(10, service, "US");
DateOnly fyClose = anyDay.LastWorkingDayOfFiscalYear(10, service, "US");

// The working-day bounds of the containing fiscal quarter.
DateOnly qOpen = anyDay.FirstWorkingDayOfFiscalQuarter(10, service, "US");

Remarks

A fiscal year is identified by the calendar month it starts in (for example July for a 1 July fiscal year). Fiscal quarters are the four consecutive three-month spans from that start. The boundary working day is the working day on or inside the boundary, found by snapping the period's first day forward and its last day backward.

Methods

FirstWorkingDayOfFiscalQuarter(DateOnly, int, INotableDateService, string, WeekPattern?)

Returns the first working day of the fiscal quarter that contains the date.

public static DateOnly FirstWorkingDayOfFiscalQuarter(this DateOnly date, int fiscalYearStartMonth, INotableDateService service, string territory, WeekPattern? workingWeek = null)

Parameters

date DateOnly

A date within the fiscal quarter.

fiscalYearStartMonth int

The calendar month the fiscal year starts in.

service INotableDateService

The service used to resolve notable dates.

territory string

The requested territory code.

workingWeek WeekPattern?

The working-week pattern, or null for Monday to Friday.

Returns

DateOnly

The first working day of the fiscal quarter.

Exceptions

ArgumentNullException

service or territory is null.

ArgumentOutOfRangeException

fiscalYearStartMonth is not between 1 and 12.

FirstWorkingDayOfFiscalYear(DateOnly, int, INotableDateService, string, WeekPattern?)

Returns the first working day of the fiscal year that contains the date.

public static DateOnly FirstWorkingDayOfFiscalYear(this DateOnly date, int fiscalYearStartMonth, INotableDateService service, string territory, WeekPattern? workingWeek = null)

Parameters

date DateOnly

A date within the fiscal year.

fiscalYearStartMonth int

The calendar month the fiscal year starts in.

service INotableDateService

The service used to resolve notable dates.

territory string

The requested territory code.

workingWeek WeekPattern?

The working-week pattern, or null for Monday to Friday.

Returns

DateOnly

The first working day of the fiscal year.

Exceptions

ArgumentNullException

service or territory is null.

ArgumentOutOfRangeException

fiscalYearStartMonth is not between 1 and 12.

LastWorkingDayOfFiscalQuarter(DateOnly, int, INotableDateService, string, WeekPattern?)

Returns the last working day of the fiscal quarter that contains the date.

public static DateOnly LastWorkingDayOfFiscalQuarter(this DateOnly date, int fiscalYearStartMonth, INotableDateService service, string territory, WeekPattern? workingWeek = null)

Parameters

date DateOnly

A date within the fiscal quarter.

fiscalYearStartMonth int

The calendar month the fiscal year starts in.

service INotableDateService

The service used to resolve notable dates.

territory string

The requested territory code.

workingWeek WeekPattern?

The working-week pattern, or null for Monday to Friday.

Returns

DateOnly

The last working day of the fiscal quarter.

Exceptions

ArgumentNullException

service or territory is null.

ArgumentOutOfRangeException

fiscalYearStartMonth is not between 1 and 12.

LastWorkingDayOfFiscalYear(DateOnly, int, INotableDateService, string, WeekPattern?)

Returns the last working day of the fiscal year that contains the date.

public static DateOnly LastWorkingDayOfFiscalYear(this DateOnly date, int fiscalYearStartMonth, INotableDateService service, string territory, WeekPattern? workingWeek = null)

Parameters

date DateOnly

A date within the fiscal year.

fiscalYearStartMonth int

The calendar month the fiscal year starts in.

service INotableDateService

The service used to resolve notable dates.

territory string

The requested territory code.

workingWeek WeekPattern?

The working-week pattern, or null for Monday to Friday.

Returns

DateOnly

The last working day of the fiscal year.

Exceptions

ArgumentNullException

service or territory is null.

ArgumentOutOfRangeException

fiscalYearStartMonth is not between 1 and 12.

Applies to

ProductVersions
.NET8, 10

See Also