@saxnpaule said in Date / Time difference expressions and calculation:
startDate < endDate the value should be negative. For upcoming events you say “t minus x days”.
Well, yes, you can see it that way.
Another issue may be, some people may expect the value to be 1
or -1
even the time span between start and end is less than 24 hours, but the dates are on different days of the week, say Monday late night and Tuesday early morning. In this case the calculation based on milliseconds breaks. Actually, the matter can get rather complex as shown in the following thread on Joda-Time “daysBetween”. My suggestion is to stick to absolute values based on milliseconds (basically what you have implemented). However, we need to document the behavior clearly.
@Heizelmann What’s your view on this?