[BUG] DateArithmetic error

I imported a 7.9.10 project into 8 and am getting an error on an expression that previously worked:

dateArithmetic({[.]Current_Shift_Start}, {[.]Site Shift Data/Shift_Time/Shift_Seconds_Total} - 1, “sec”)

It doesn’t seem to like the tag in the subtraction:

‘dateArithmetic’ function expected a ‘numeric’ second argument, but got a class java.lang.Object

Wrapping another dateArithmetic around it does work but I hope I don’t have to do this:

dateArithmetic(dateArithmetic({[.]Current_Shift_Start}, {[.]Site Shift Data/Shift_Time/Shift_Seconds_Total}, “sec”), -1, “sec”)

1 Like

dateArithmetic({[.]Current_Shift_Start}, toInt({[.]Site Shift Data/Shift_Time/Shift_Seconds_Total} - 1), “sec”)

Adding toInt should work for now, but this is actually something we’re planning to improve - basically, the notion of expressions requiring static datatypes is going away, so they’ll simply attempt to coerce whenever possible. No exact ETA, but should be in soon.

1 Like

Cool - thanks. I had tried the toInt but only around the tag reference. Your workaround is good for now.