In the attached project, the SfDatePicker Min and Max values can be changed by using the custom "Date Options" button and it works fine as long as this is the first thing the user does. However it only works if the calendar is not yet displayed (by user clicking on it), otherwise the valid dates in the current month won't be available but the ones in the previous/next months will
Note: The Button
doesn't
show up in the calendar although it is set to.
@code {
public DateOnly? StartDate { get; set; }
DateTime minStartDate = DateTime.Today.Date;
DateTime maxStartDate = DateTime.Today.Date.AddDays(30);
async Task OnDropdownButtonDateOptions(Syncfusion.Blazor.SplitButtons.MenuEventArgs args)
{
if (args.Item == null) { await Task.CompletedTask;}
else if (args.Item.Id == "previousDate")
{
//StartDate = null;
//await InvokeAsync(StateHasChanged);
minStartDate = DateTime.Today.AddDays(-180);
maxStartDate = DateTime.Today;
}
else if (args.Item.Id == "futureDate")
{
//StartDate = null;
//await InvokeAsync(StateHasChanged);
minStartDate = DateTime.Today;
maxStartDate = DateTime.Today.AddDays(180);
}
}
}
Attachment: RPTest_6af1ee72.zip