Loading...
 
Features / Usability

Features / Usability


mathematical calculation tracker field

posts: 228 Ukraine
Jonny Bradley wrote:

Maybe more brackets would do it?

(date (str H:i) (sub futureDate (date)))


I did see there might be an issue with brackets, but I guess all the variations I tried were incorrect. Your version works better, does not produce any errors, and, also provides a time.

However, it does not seem to be calculating correctly. For example, if the 'future date' is this Friday, August 21st (so 3 - 4 days away, depending on time), it shows only 16 hours (and minutes, of course) or 13 hours (when I just checked again:

  • future date: 21-08-2020 08:00
  • calculation: 13:50

I thought maybe it was calculating only up to 24 hours in advance (ignoring the date) but even the time does not add up. I would assume Tiki would be using the system time zone so most likely no issues there? But in any case, it is not calculating correctly as it should be something like 80 hours at least.

Just to test, I tried a 'past' future date:

  • today is August 17
  • future date entered: 15-08-2020 00:00
  • calculation: 05:32

Some how I just can't seem to draw any conclusions as to where it is getting the calculated time.

Also to test I tried adding two more mathematical calculation fields:

1)
Copy to clipboard
(date (str Y-m-d H:i:s))
so it would just list the current date/time 2)
Copy to clipboard
(date (str H:i)(sub futuredate CurrentDateTime))

this one shows zero / null with the 'back' date.

  • current time: 2020-08-17 21:39:44
  • calculation: 11:00

here the only thing I see is that it is just simply listing the 'time' part of the 'date/time' 'future time' (21-08-2020 11:00)

Maybe there is a bug with time/date calculations? (I'm testing on Tiki 18.7)
thanks,
Mike

There are no comments at this time.