Interface IWeekYearRule
A rule determining how "week years" are arranged, including the weeks within the week year.
Implementations provided by Noda Time itself can be obtained via the
WeekYearRules
class.
Since 1.4.x
Availability netstandard2.0
Assembly: NodaTime.dll
Syntax
public interface IWeekYearRule
Methods
GetLocalDate(Int32, Int32, IsoDayOfWeek, CalendarSystem)
Creates a
LocalDate from a given week-year, week within that week-year,
and day-of-week, for the specified calendar system.
Since 1.4.x
Availability netstandard2.0
Declaration
LocalDate GetLocalDate(int weekYear, int weekOfWeekYear, IsoDayOfWeek dayOfWeek, CalendarSystem calendar)
Parameters
Type |
Name |
Description |
Int32 |
weekYear |
The week-year of the new date. Implementations provided by Noda Time allow any
year which is a valid calendar year, and sometimes one less than the minimum calendar year
and/or one more than the maximum calendar year, to allow for dates near the start of a calendar
year to fall in the previous week year, and similarly for dates near the end of a calendar year. |
Int32 |
weekOfWeekYear |
The week of week-year of the new date. Valid values for this parameter
may vary depending on weekYear , as the length of a year in weeks varies. |
IsoDayOfWeek |
dayOfWeek |
The day-of-week of the new date. Valid values for this parameter may vary
depending on weekYear and weekOfWeekYear . |
CalendarSystem |
calendar |
The calendar system for the date. |
Returns
Exceptions
Type |
Condition |
ArgumentOutOfRangeException |
The parameters do not combine to form a valid date. |
GetWeekOfWeekYear(LocalDate)
Calculates the week of the week-year in which the given date occurs, according to this rule.
Since 1.4.x
Availability netstandard2.0
Declaration
int GetWeekOfWeekYear(LocalDate date)
Parameters
Type |
Name |
Description |
LocalDate |
date |
The date to compute the week of. |
Returns
Type |
Description |
Int32 |
The week of the week-year of date , according to this rule. |
GetWeeksInWeekYear(Int32, CalendarSystem)
Returns the number of weeks in the given week-year, within the specified calendar system.
Since 1.4.x
Availability netstandard2.0
Declaration
int GetWeeksInWeekYear(int weekYear, CalendarSystem calendar)
Parameters
Type |
Name |
Description |
Int32 |
weekYear |
The week-year to find the range of. |
CalendarSystem |
calendar |
The calendar system the calculation is relative to. |
Returns
Type |
Description |
Int32 |
The number of weeks in the given week-year within the given calendar. |
GetWeekYear(LocalDate)
Calculates the week-year in which the given date occurs, according to this rule.
Since 1.4.x
Availability netstandard2.0
Declaration
int GetWeekYear(LocalDate date)
Parameters
Type |
Name |
Description |
LocalDate |
date |
The date to compute the week-year of. |
Returns
Type |
Description |
Int32 |
The week-year of date , according to this rule. |
Extension Methods