adobe / json-formula

Query language for JSON documents
http://opensource.adobe.com/json-formula/
Apache License 2.0
19 stars 8 forks source link

Misc date fixes #120

Closed JohnBrinkman closed 8 months ago

JohnBrinkman commented 8 months ago

This issue summarizes some of the necessary code and documentation changes arising from discussion on https://github.com/adobe/json-formula/issues/117

maxwyss commented 8 months ago

Would it make sense if datedif() would return a negative number when end_date < start_date?

JohnBrinkman commented 8 months ago

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.

JohnBrinkman commented 8 months ago

Note as well: