Class
WeekInterval

Defines an interval of one week.

Definition

Constructors

WeekInterval()

Declaration

cs-api-definition
public WeekInterval()

Properties

FirstDayOfWeek

Gets the first day of the week.

Declaration

cs-api-definition
public static DayOfWeek FirstDayOfWeek { get; }

Property Value

DayOfWeek

An enumeration value that represents the first day of the week.

Formatters

Gets a collection of formatters used to convert DateTime objects to specific strings.

Declaration

cs-api-definition
public override Func<DateTime, string>[] Formatters { get; }

Property Value

Func<DateTime, string>[]

A collection of formatters.

Overrides IntervalBase.Formatters

Remarks

The Formatters collection is used when CurrentIntervalSpan equals 1; otherwise, the IntervalSpanFormatters collection is used.

MinimumPeriodLength

Gets the smallest interval period.

Declaration

cs-api-definition
public override TimeSpan MinimumPeriodLength { get; }

Property Value

TimeSpan

The smallest interval period.

Overrides IntervalBase.MinimumPeriodLength

Methods

ExtractIntervalStart(DateTime)

Extracts the interval start from a specified DateTime object.

Declaration

cs-api-definition
public override DateTime ExtractIntervalStart(DateTime date)

Parameters

date

DateTime

The DateTime object.

Returns

DateTime

The interval start date.

Overrides IntervalBase.ExtractIntervalStart(DateTime)

GetWeekOfYear(DateTime)

Returns the week of the year that includes the date in the specified DateTime value.

Declaration

cs-api-definition
public static int GetWeekOfYear(DateTime date)

Parameters

date

DateTime

The DateTime value.

Returns

int

A positive integer that represents the week of the year that includes the date in the specified DateTime value.

IncrementByInterval(DateTime, int)

Increments a specified DateTime object by a specified number of MinimumPeriodLengths.

Declaration

cs-api-definition
public override DateTime IncrementByInterval(DateTime date, int intervalSpan)

Parameters

date

DateTime

The DateTime object.

intervalSpan

int

The number of MinimumPeriodLengths.

Returns

DateTime

The incremented DateTime object.

Overrides IntervalBase.IncrementByInterval(DateTime, int)