private bool IsItemWithinRange(CalendarItem item, DateTime startDate, DateTime endDate) { // Always show a task if it is currently being dragged if (IsResizingAppointment() && (item == SelectedAppointment)) { return(true); } if (HideParentTasks && item.IsParent) { return(false); } if (!item.HasValidDates()) { return(false); } // Task must at least intersect the range if ((item.StartDate >= endDate) || (item.EndDate <= startDate)) { return(false); } if (!DisplayTasksContinuous) { if ((item.StartDate < startDate) && (item.EndDate > endDate)) { return(false); } } if (HideTasksSpanningWeekends) { if (DateUtil.WeekOfYear(item.StartDate) != DateUtil.WeekOfYear(item.EndDate)) { return(false); } } if (HideTasksSpanningDays) { if (item.StartDate.Date != item.EndDate.Date) { return(false); } } if (HideTasksWithoutTimes) { if (CalendarItem.IsStartOfDay(item.StartDate) && CalendarItem.IsEndOfDay(item.EndDate)) { return(false); } } return(true); }
private bool IsItemWithinRange(CalendarItem item, DateTime startDate, DateTime endDate) { if (HideParentTasks && item.IsParent) { return(false); } if (!item.HasValidDates()) { return(false); } // Task must at least intersect the range if ((item.StartDate >= endDate) || (item.EndDate <= startDate)) { return(false); } if (!DisplayTasksContinuous) { if ((item.StartDate < startDate) && (item.EndDate > endDate)) { return(false); } } if (HideTasksSpanningWeekends) { if (DateUtil.WeekOfYear(item.StartDate) != DateUtil.WeekOfYear(item.EndDate)) { return(false); } } if (HideTasksSpanningDays) { if (item.StartDate.Date != item.EndDate.Date) { return(false); } } if (HideTasksWithoutTimes) { if (CalendarItem.IsStartOfDay(item.StartDate) && CalendarItem.IsEndOfDay(item.EndDate)) { return(false); } } return(true); }
private bool IsItemWithinRange(CalendarItem item, DateTime startDate, DateTime endDate) { if (HideParentTasks && item.IsParent) { return(false); } if (!item.HasValidDates()) { return(false); } bool startDateInRange = IsDateWithinRange(item.StartDate, startDate, endDate); bool endDateInRange = IsDateWithinRange(item.EndDate, startDate, endDate); // As a bare minimum, at least one of the task's dates must fall in the week if (!startDateInRange && !endDateInRange) { return(false); } if (HideTasksSpanningWeekends) { if (!startDateInRange || !endDateInRange) { return(false); } } if (HideTasksSpanningDays) { if (item.StartDate.Date != item.EndDate.Date) { return(false); } } if (HideTasksWithoutTimes) { if (CalendarItem.IsStartOfDay(item.StartDate) && CalendarItem.IsEndOfDay(item.EndDate)) { return(false); } } return(true); }
public bool IsItemDisplayable(CalendarItem item) { // Always show a task if it is currently being dragged if (IsResizingAppointment() && (item == SelectedAppointment)) { return(true); } if (HideParentTasks && item.IsParent) { return(false); } if (!item.HasValidDates()) { return(false); } if (HideTasksSpanningWeekends) { if (DateUtil.WeekOfYear(item.StartDate) != DateUtil.WeekOfYear(item.EndDate)) { return(false); } } if (HideTasksSpanningDays) { if (item.StartDate.Date != item.EndDate.Date) { return(false); } } if (HideTasksWithoutTimes) { if (CalendarItem.IsStartOfDay(item.StartDate) && CalendarItem.IsEndOfDay(item.EndDate)) { return(false); } } return(true); }
public bool IsItemDisplayable(CalendarItem item) { if (item == null) { return(false); } if (HideParentTasks && item.IsParent) { return(false); } if (!item.HasValidDates()) { return(false); } if (HideTasksSpanningWeekends) { if (DateUtil.WeekOfYear(item.StartDate) != DateUtil.WeekOfYear(item.EndDate)) { return(false); } } if (HideTasksSpanningDays) { if (item.StartDate.Date != item.EndDate.Date) { return(false); } } if (HideTasksWithoutTimes) { if (CalendarItem.IsStartOfDay(item.StartDate) && CalendarItem.IsEndOfDay(item.EndDate)) { return(false); } } return(true); }