Closed chris-parker-bliss closed 2 weeks ago
It looks like the Blazorise picker is built on flatpickr, which has the ability to disable based on a function (see https://flatpickr.js.org/examples/#disabling-dates-by-a-function) so perhaps this could be leveraged?
The problem with this function is that it is a JavaScript function. There is no easy way to translate C# function into JS. Or to invoke asyncrounous function from synchronous function in JS.
Back to your problem. We could add DisabledDays
which would handle it internally by making use of flatpickr function. That could work easily.
That makes sense @stsrki, thanks for your response, sounds promising!
I'm looking for a Blazor date-time picker to use for selecting delivery date on an eCommerce site. The problem is that as well as disabling particular dates we also need to the ability to disable days of the week (no post on Sundays).
Ideally I'd imagine this would work almost exactly the same as the existing
DisabledDates
attribute, but instead of an array ofDateTime
values it could take an array ofDayOfWeek
values.