Closed JohnBrinkman closed 8 months ago
Would it make sense if datedif() would return a negative number when end_date < start_date?
Would it make sense if datedif() would return a negative number when end_date < start_date?
Maybe we could. But negative differences don't always make sense. For example, a common use of this function is to calculate someone's age. In that case, we never want a negative value, and the author will be better served by having the order of parameters enforced.
Note as well:
[d1,d2].datedif(min(@), max(@), "d")
This issue summarizes some of the necessary code and documentation changes arising from discussion on https://github.com/adobe/json-formula/issues/117