secondsBetween

0
Reported a secondsBetween problem in 5.14.0. Now this seems to be fixed in 5.14.1. However the releasenotes say: Ensure that computing the difference between dates in microflow expressions results in an absolute value. After discovering the secondsBetween problem (returning a negative value if second date > first date) I am afraid to run into the next problem (that a positive value is returned if second date < first date). (1) Am I running into the next problem? (2) Shouldnot all users be informed up-front if such a basic Mendix function is changed?
asked
3 answers
1

(1) You will not run into the next problem: if you use the negative value, you are using the function incorrectly: according to the documentation found here, it will always return the absolute value. Take a look at the example for minutesBetween. (I realize that the v5 documentation has been updated after the 5.14.1 release, but Google's cache shows that that information hasn't changed)

(2) All user are actually informed about this: it's in the release notes.

What exactly is the point you want to make?

answered
0

As programmers, we all know how difficult it is to keep our heads wrapped around every change we make and document every move or correction. As our apps grow, it is hard for us to test every scenario before we release a new version. That being said, I have two comments: 1. Mendix gives us a platform to test as thoroughly as we are willing in two environments before we release to production. 2. I always validate date-time parameters before I pass them to a function and throw a message and/or log entry if incorrect.

answered
0

I understand this and I don't blame anyone. However, in this specific situation the function returned a negative value. Although documentation explained something else, I can understand this. If date-2 -/- date-1 returns a positive value then date-1 -/- date-2 should return a positive value I would assume. The programmer also could have decided to change the documentation, because everyone trusting the documentation would have had problems before with negative values and would have adapted this regardless of the documentation. These people, like me, now have to solve the same problem twice.

answered