Hi,
i want that i can create appointments which are 3 or 4 weeks long..
Is it possible to ignore the Weekends which are between the appointment? Or can they be made readonly or something else.. when i set IsReadOnly = true i can max use 5 days (mo - fr) for an appointment because saturday and sunday are blocked..
private
void
CreateWeekendBlockedDates()
{
var weekEnds =
new
List<DateTime>();
//new list with Weekends
DateTime startDate;
if
(DateTime.Today.DayOfWeek == DayOfWeek.Saturday)
//today = saturday?
{
startDate = DateTime.Today;
}
else
{
var diffDay = DateTime.Today.DayOfWeek - DayOfWeek.Saturday;
startDate = DateTime.Today.AddDays(-diffDay);
}
//takes all weekends in 70 days past and 10 years future
for
(var dt = startDate.AddDays(-70); dt < startDate.AddYears(10); dt = dt.AddDays(7))
{
weekEnds.Add(dt);
}
foreach
(var weekEnd
in
weekEnds)
{
SpecialSlots.Add(
new
DaySlot(weekEnd, weekEnd.AddDays(2))
{
Description =
""
,
IsReadOnly =
true //other possibilities?
});
}
}
Regards