DxDateRangePicker<T>.MaxDate Property
Specifies the maximum date that can be selected in the Date Range Picker.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public DateTime MaxDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime | A DateTime value that specifies the maximum date. |
Remarks
You can use the MinDate and MaxDate
properties to limit the available date range.
<DxDateRangePicker @bind-StartDate="@DateTimeStart"
@bind-EndDate="@DateTimeEnd"
MinDate="@MinDate"
MaxDate="@MaxDate"/>
@code {
DateTime DateTimeStart { get; set; } = DateTime.Today;
DateTime DateTimeEnd { get; set; } = DateTime.Today.AddDays(7);
DateTime MinDate { get; set; }
DateTime MaxDate { get; set; }
protected override void OnInitialized() {
MinDate = DateTimeStart.AddDays(-7);
int days = DateTime.DaysInMonth(DateTimeStart.Year, DateTimeStart.Month);
MaxDate = new DateTime(DateTimeStart.Year, DateTimeStart.Month, days).AddDays(14);
}
}
See Also