feat: disabled date related feature.
This commit is contained in:
17
src/Ursa/Controls/DateTimePicker/IDateSelector.cs
Normal file
17
src/Ursa/Controls/DateTimePicker/IDateSelector.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public interface IDateSelector
|
||||
{
|
||||
public bool IsValid(DateTime? date);
|
||||
}
|
||||
|
||||
public class WeekendDateSelector: IDateSelector
|
||||
{
|
||||
public static WeekendDateSelector Instance { get; } = new WeekendDateSelector();
|
||||
|
||||
public bool IsValid(DateTime? date)
|
||||
{
|
||||
if (date is null) return false;
|
||||
return date.Value.DayOfWeek == DayOfWeek.Saturday || date.Value.DayOfWeek == DayOfWeek.Sunday;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user