- Local time
- 9:48 PM
- Posts
- 31
- OS
- Wimdows 10
there is something else which either doesn't work or I am not using correctly:
CSS:/* future: before start date, not due today */ /* doesn't work. Affects all not-started-items, not just those with due date */ .calendar-task-tree > treechildren::-moz-tree-cell-text(future) {color:orange!important}
I think this is supposed to style all tasks with a due-date in the the future.
But in my tests, this styles all "unstarted" tasks with or without due-date.
Looking through the source, I figured out how it works:
There are 5 different possible progress states of a task:
- future
- inprogress: if either condition is met: (has start date OR % completed > 0 OR status = "in process")
- completed: if it has the "completed" checkmark in the checkbox
- duetoday: due date = today
- overdue: due date = in the past
Unfortunately, this includes tasks with AND without due date. So, I still have to figure out how to style them differently.
JavaScript:
/**
* This function return the progress state of a task:
* completed, overdue, duetoday, inprogress, future
*
* @param aTask The task to check.
* @returns The progress atom.
*/
getProgressAtom(aTask) {
let nowdate = new Date();
if (aTask.recurrenceInfo) {
return "repeating";
}
if (aTask.isCompleted) {
return "completed";
}
if (aTask.dueDate && aTask.dueDate.isValid) {
if (cal.dtz.dateTimeToJsDate(aTask.dueDate).getTime() < nowdate.getTime()) {
return "overdue";
} else if (
aTask.dueDate.year == nowdate.getFullYear() &&
aTask.dueDate.month == nowdate.getMonth() &&
aTask.dueDate.day == nowdate.getDate()
) {
return "duetoday";
}
}
if (
aTask.entryDate &&
aTask.entryDate.isValid &&
cal.dtz.dateTimeToJsDate(aTask.entryDate).getTime() < nowdate.getTime()
) {
return "inprogress";
}
return "future";
},
};
My Computer
System One
-
- OS
- Wimdows 10