Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Telerik
Build great .NET business apps
Net Web
Cross-Platform
Desktop
Reporting and Documents
Testing & Mocking
Debugging
Build JavaScript UI
Javascript
AI for Developers & IT
Ensure AI program success
AI Coding
Additional Tools
Enhance the developer and designer experience
UI/UX Tools
Free Tools
CMS
Support and Learning
Docs & Resources
Productivity and Design Tools
Hello,
I'm glad to see you are creating a Blazor app.
To disable all dates except Monday, use the DatePicker DisabledDates parameter. Here is an example I prepared for you:
<TelerikDatePicker @bind-Value="datePickerValue" Format="dd MMMM yyyy" Min="@Min" Max="@Max" DisabledDates="DisabledDates"> </TelerikDatePicker> @code { IEnumerable<DateTime> GetDaysBetween(DateTime start, DateTime end) { for (DateTime i = start; i < end; i = i.AddDays(1)) { yield return i; } } protected override async Task OnInitializedAsync() { var disabledDates = GetDaysBetween(Min, Max) .Where(d => d.DayOfWeek != DayOfWeek.Monday); DisabledDates = new List<DateTime>(disabledDates); } private List<DateTime> DisabledDates = new List<DateTime>(); DateTime datePickerValue { get; set; } = new DateTime(2022, 4, 25, 19, 30, 45); public DateTime Min = new DateTime(1990, 1, 1, 8, 15, 0); public DateTime Max = new DateTime(2025, 1, 1, 19, 30, 45); }
Please run and test it to see the result.
In short, the example loops through all the dates between Min and Max. Then, it gets only the dates that are not Monday.
I hope this helps. If there is anything else we can help with, I would be glad.
Thank you.
Regards, Hristian Stefanov Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.