XamForms.Controls.Calendar
XamForms.Controls.Calendar copied to clipboard
Disable specific datesq
Is there any way to disable specific dates?
sample:
var disabledDates = new List<DateTime>() { new DateTime(2018, 06, 11),
new DateTime(2018, 06, 13),
new DateTime(2018, 06, 14),
new DateTime(2018, 06, 25)
};
<controls:Calendar DisabledDates="{Binding DisabledDates}" />
Hi @rodrigueslg , It's possible . Try this code; Here you can add special dates if it is SAT or SUN and set your special dates are "Un selectable"
for (DateTime i = MinimumDate; i < MinimumDate.AddMonths(2); i = i.AddDays(1)) { if ((i.DayOfWeek == DayOfWeek.Saturday) || (i.DayOfWeek == DayOfWeek.Sunday)) { SpecDate.Add(new SpecialDate(i) { TextColor = Color.Gray, Selectable = false, FontSize = 10, BackgroundPattern = new BackgroundPattern(1) { Pattern = new List { new Pattern{ WidthPercent = 1f, HightPercent = 1f, Color = Color.Transparent,Text = "", TextSize =11, TextAlign=TextAlign.CenterBottom} } } }); } }