Skip to content

Applies to

net10.0, net10.0-windows10.0.19041, net10.0-desktop1.0, net10.0-browserwasm1.0, net9.0, net9.0-windows10.0.19041, net9.0-desktop1.0, net9.0-browserwasm1.0, net8.0, net8.0-macos14.5, net8.0-windows10.0.19041, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-tvos17.2, netstandard2.1, net471, net481

public DateTimeRange(DateTimeOffset? start, DateTimeOffset? end, DateTimeRangePreset preset = Custom, string? label = null, bool isEndInclusive = true, TimeSpan? maximumDuration = null)

View source

Summary: Initializes a new instance of the DateTimeRange class.

Parameters

NameTypeDescription
startDateTimeOffset?The inclusive range start.
endDateTimeOffset?The inclusive or exclusive range end.
preset = 0[DateTimeRangePreset](#The preset that produced the range.
label = nullstring?Optional user-facing label used by range picker controls.
isEndInclusive = trueboolA value indicating whether the end instant is inclusive.
maximumDuration = nullTimeSpan?Optional maximum allowed duration.