SearchKit: Add TIMESTAMPDIFF to calculate between two dates in years, months, weeks, etc.
Overview
Allow to calculate number of days, weeks, months, years, etc. between two dates.
DATEDIFF only allows to calculate difference between two days in days. Instead, TIMESTAMPDIFF allows set the unit (years, months, weeks, etc.) units in which you want to get the difference between two dates.
Eg. to calculate age of a contact at the time they registered for an event between contact birthday and registration event date.
Current behaviour
Can't calculate years between two dates.
Proposed behaviour
Can calculate years (and FRAC_SECOND (microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER) between two dates.
Comments
TIMESTAMPDIFF can in principle reproduce the same behavior as DATEDIFF. If so, current Days between two dates field transformation could be replaced with Diff between two dates ensuring that it continues to work for old cases.