Ryan wrote: ↑Mon Dec 30, 2024 3:26 am
I think a custom calculation in TDL involving dates that doesn't make sense is adding them together.
This is already disallowed.
Ryan wrote: ↑Mon Dec 30, 2024 3:26 am
If positive it would show how many days are left until the Task starts.
If negative it would show how many days have passed since the Task started.
If only it were quite that simple.
1. Let's take a more interesting example: Due - Start, where both point to the same day.
Q: How long is the task?
a) If you say 0D, then how are we supposed to display the task in the Calendar?
b) If you say 1D (which is the correct answer to me) then it can only be because the whole of the Due date is being taken into account.
2. Now let's say that the Due date is one day before the Start date.
Q: How long is the task now?
If we accept b) from before then the answer this time must be 0D, even if intuitively you would say it should be -1D.
And if you argue that the answer should be -1D, then we have a strange situation where 'Due - Start' is never zero, it magically jumps from 1D to -1D (without passing Go and collecting $200)
3. Now let's reverse the calculation: Start - Due, where both point to the same date.
Q: How long is the task now?
Q: And what's your reasoning?
The reason that I've avoided your specific example is not because it is without its own problem, but to highlight that there are more difficult examples all of which must be resolved in a consistent way. We can't have one lot of date calculations (ie Reminders or Custom Calculations or Task Duration) not being consistent with all the others.
Ryan wrote: ↑Mon Dec 30, 2024 3:26 am
all date related calculations in custom attributes will be one date minus another date
Consider:
Calculation 1: (Due - Start) => produces a Time Period
Calculation 2: (Last Modified + Calculation 1) => produces a Date
Calculation 3: (Today - Start) => produces a Time Period
Calculation 4: (Calculation 2 + Calculation 3) => produces a Date
I'm not saying that this represents a meaningful outcome, just that it is possible to construct such a calculation and the answer to the calculation has to be justifiable. ie. it must follow the same specific rules to which all date calculations are subject.