directus-extension-computed-interface
directus-extension-computed-interface copied to clipboard
Tying to calculate the sum of days from two date time inputs?
Tying to calculate the sum of days from two date time inputs, such as:
{{ DAY(SUBTRACT(end, start)) }}
or
{{ SUBTRACT(DAY(end), DAY(start)) }}
But just getting 0, debug doesn't seem to display anything:
Probably user error...
After some breif debugging, the following don't appear to be working?
YEAR(a)
| get year of a date object, similar to getFullYear
MONTH(a)
| get month of a date object, similar to getMonth
GET_DATE(a)
| get date of a date object, similar to getDate
DAY(a)
| get day of a date object, similar to getDay
However this seems to work:
{{ SUBTRACT(GET_DATE(DATE(end)), GET_DATE(DATE(start))) }}