英文:
How to exclude from the selection, for example: Monday and Friday in the MudDatePicker component?
问题
I have problem with Mudblazor framework, because i can't find solution to my problem
如何在MudDatePicker组件中排除选择,例如:星期一和星期五?
我使用Mudblazor框架。
Kind regards,
Lukasz
英文:
I have problem with Mudblazor framework, because i can't find solution to my problem
How to exclude from the selection, for example: Monday and Friday in the MudDatePicker component?
I using Mudblazor framework.
Kind regards,
Lukasz
答案1
得分: 0
你可以在你的 MudDatePicker
组件上使用 IsDateDisabledFunc
属性:
<MudDatePicker @bind-Date="SelectedDate"
IsDateDisabledFunc="CheckIsDateDisabled" />
@code {
private DateTime? SelectedDate { get; set; }
private bool CheckIsDateDisabled(DateTime date) => date.DayOfWeek is DayOfWeek.Monday or DayOfWeek.Friday;
}
英文:
You can use the IsDateDisabledFunc
attribute on your MudDatePicker
component:
<MudDatePicker @bind-Date="SelectedDate"
IsDateDisabledFunc="CheckIsDateDisabled" />
@code {
private DateTime? SelectedDate { get; set; }
private bool CheckIsDateDisabled(DateTime date) => date.DayOfWeek is DayOfWeek.Monday or DayOfWeek.Friday;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论