NotableDateFiscalExtensions Class
Definition
- Namespace
- Bodu.Extensions
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
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
dateDateOnlyA date within the fiscal quarter.
fiscalYearStartMonthintThe calendar month the fiscal year starts in.
serviceINotableDateServiceThe service used to resolve notable dates.
territorystringThe requested territory code.
workingWeekWeekPattern?The working-week pattern, or null for Monday to Friday.
Returns
- DateOnly
The first working day of the fiscal quarter.
Exceptions
- ArgumentNullException
serviceorterritoryis null.- ArgumentOutOfRangeException
fiscalYearStartMonthis 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
dateDateOnlyA date within the fiscal year.
fiscalYearStartMonthintThe calendar month the fiscal year starts in.
serviceINotableDateServiceThe service used to resolve notable dates.
territorystringThe requested territory code.
workingWeekWeekPattern?The working-week pattern, or null for Monday to Friday.
Returns
- DateOnly
The first working day of the fiscal year.
Exceptions
- ArgumentNullException
serviceorterritoryis null.- ArgumentOutOfRangeException
fiscalYearStartMonthis 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
dateDateOnlyA date within the fiscal quarter.
fiscalYearStartMonthintThe calendar month the fiscal year starts in.
serviceINotableDateServiceThe service used to resolve notable dates.
territorystringThe requested territory code.
workingWeekWeekPattern?The working-week pattern, or null for Monday to Friday.
Returns
- DateOnly
The last working day of the fiscal quarter.
Exceptions
- ArgumentNullException
serviceorterritoryis null.- ArgumentOutOfRangeException
fiscalYearStartMonthis 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
dateDateOnlyA date within the fiscal year.
fiscalYearStartMonthintThe calendar month the fiscal year starts in.
serviceINotableDateServiceThe service used to resolve notable dates.
territorystringThe requested territory code.
workingWeekWeekPattern?The working-week pattern, or null for Monday to Friday.
Returns
- DateOnly
The last working day of the fiscal year.
Exceptions
- ArgumentNullException
serviceorterritoryis null.- ArgumentOutOfRangeException
fiscalYearStartMonthis not between 1 and 12.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |