* Get tasks for a specific date within an agenda view * Handles recurring tasks, due dates, scheduled dates, and overdue logic
( date: Date, baseQuery: FilterQuery, includeOverdue = false )
| 679 | * Handles recurring tasks, due dates, scheduled dates, and overdue logic |
| 680 | */ |
| 681 | async getTasksForDate( |
| 682 | date: Date, |
| 683 | baseQuery: FilterQuery, |
| 684 | includeOverdue = false |
| 685 | ): Promise<TaskInfo[]> { |
| 686 | // FIXED: Use UTC Anchor principle for consistent date handling |
| 687 | const dateStr = formatDateForStorage(date); |
| 688 | const isViewingToday = isTodayUtil(dateStr); |
| 689 | |
| 690 | // Get all tasks and filter using new system |
| 691 | const allTaskPaths = this.cacheManager.getAllTaskPaths(); |
| 692 | const allTasks = await this.pathsToTaskInfos(Array.from(allTaskPaths)); |
| 693 | const filteredTasks = allTasks.filter((task) => this.evaluateFilterNode(baseQuery, task)); |
| 694 | const hideCompletedFromOverdue = this.runtime?.settings?.hideCompletedFromOverdue ?? true; |
| 695 | |
| 696 | const tasksForDate = filteredTasks.filter((task) => |
| 697 | isTaskForAgendaDate(task, { |
| 698 | dateStr, |
| 699 | isViewingToday, |
| 700 | includeOverdue, |
| 701 | hideCompletedFromOverdue, |
| 702 | isCompletedStatus: (status) => this.statusManager.isCompletedStatus(status), |
| 703 | }) |
| 704 | ); |
| 705 | |
| 706 | // Apply sorting to the filtered tasks for this date |
| 707 | return this.sortTasks( |
| 708 | tasksForDate, |
| 709 | baseQuery.sortKey || "due", |
| 710 | baseQuery.sortDirection || "asc" |
| 711 | ); |
| 712 | } |
| 713 | |
| 714 | /** |
| 715 | * Get overdue tasks for the agenda view |
no test coverage detected