Widget Devoir Finition

This commit is contained in:
alma 2026-01-24 12:55:51 +01:00
parent 668095c6e0
commit 8f9c01ebea

View File

@ -175,16 +175,22 @@ export function Duties() {
const filteredTasks = allTasks.filter((task: Task) => {
// Exclude tasks with status Done (5) - check both number and string formats
const taskStatus = typeof task.status === 'string' ? parseInt(task.status, 10) : task.status;
if (taskStatus === 5 || task.status === '5' || task.status === 'Done' || task.status === 'done' || task.status === 'DONE') {
const rawStatus = (task as any).status; // Use any to handle potential string/number mismatch
if (rawStatus === null || rawStatus === undefined) {
// If status is null/undefined, keep the task (let other filters handle it)
} else {
const taskStatus = typeof rawStatus === 'string' ? parseInt(rawStatus, 10) : rawStatus;
const statusStr = typeof rawStatus === 'string' ? rawStatus.toLowerCase() : String(rawStatus).toLowerCase();
if (taskStatus === 5 || statusStr === '5' || statusStr === 'done') {
console.log('[Devoirs Widget] Filtering out done task:', {
id: task.id,
headline: task.headline,
status: task.status,
status: rawStatus,
taskStatus,
});
return false;
}
}
const dueDate = getValidDate(task);
if (!dueDate) {