Class WeekYearRuleExtensions
Extension methods on IWeekYearRule.
Since 1.4.x
Availability net35-Client, PCL
Inheritance
Object
WeekYearRuleExtensions
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime.Calendars
Assembly: NodaTime.dll
Syntax
public static class WeekYearRuleExtensions
Methods
GetLocalDate(IWeekYearRule, Int32, Int32, IsoDayOfWeek)
Convenience method to call GetLocalDate(Int32, Int32, IsoDayOfWeek, CalendarSystem)
passing in the ISO calendar system.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public static LocalDate GetLocalDate(this IWeekYearRule rule, int weekYear, int weekOfWeekYear, IsoDayOfWeek dayOfWeek)
Parameters
Type | Name | Description |
---|---|---|
IWeekYearRule | rule | The rule to delegate the call to. |
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 . |
Returns
Type | Description |
---|---|
LocalDate | A LocalDate corresponding to the specified values. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The parameters do not combine to form a valid date. |
ArgumentNullException | rule is null. |
GetWeeksInWeekYear(IWeekYearRule, Int32)
Convenience overload to call GetWeeksInWeekYear(Int32, CalendarSystem) with
the ISO calendar system.
Since 1.4.x
Availability net35-Client, PCL
Declaration
public static int GetWeeksInWeekYear(this IWeekYearRule rule, int weekYear)
Parameters
Type | Name | Description |
---|---|---|
IWeekYearRule | rule | The rule to delegate the call to. |
Int32 | weekYear | The week year to calculate the number of contained weeks. |
Returns
Type | Description |
---|---|
Int32 | The number of weeks in the given week year. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | rule is null. |