I'm trying to blackout dates in my datetime picker control starting from day after today till datetime max value.
The below is the code:
<Calendar.BlackoutDates>
<CalendarDateRange Start="{x:Static System:DateTime.Today}"
End="{x:Static System:DateTime.MaxValue}" />
</Calendar.BlackoutDates>
As you could see, the above code will blackout dates starting from today, but I want the start date from tomorrow. Basically the question is, how can I set something like this:
Start="{x:Static System:DateTime.Today.AddDays(1)}"
Could you please help?
You can create your own static property for this.
public static class DateTimeHelper
{
public static DateTime Tomorrow
{
get { return DateTime.Today.AddDays(1); }
}
}
.
<CalendarDateRange Start="{x:Static app:DateTimeHelper.Tomorrow}"…
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With