Open Hirad2hhk opened 3 months ago
Hi,
You can set the start, end, or both dates by doing this:
<MudDateRangePicker @bind-DateRange="@dateRange"/>
// Only set start
DateRange dateRange = new DateRange(DateTime.Now.Date, null);
//OR
// Only set end
DateRange dateRange = new DateRange(null, DateTime.Now.Date);
//OR
// Set both
DateRange dateRange = new DateRange(DateTime.Now.Date, DateTime.Now.AddDays(5).Date);
Result (only setting start):
Is this what you are looking for?
Hi @digitaldirk , Thanks for your reply, I Know that it works for the text field, the issue is that the fixation doesn't work for the calendar itself. for example, when the start date is fixed the first click in the calendar is still taking input for the start of the range. also preselecting the dates like you mentioned sometimes cause blank fields and lags. there are some methods mentioned the api by mud like SelectStart and others but they don't work right.
Feature request type
Enhance component
Component name
MudDateRangePicker
Is your feature request related to a problem?
I tried to pre select the start date of the range but through no solution could achieve this and couldn't get any help
Describe the solution you'd like
It would be very handy to be able to pre-select and fix start or end date of the range
Have you seen this feature anywhere else?
No response
Describe alternatives you've considered
No response
Pull Request
Code of Conduct