Open
Description
This is a proposal to extend the duration function in order to allow retrieving the unit. You can use this as follows:
{"duration": [{"-": [{"date": "2025-02-10"}, {"date": "1978-01-01"}]}, "days"]}
This returns:
17207
This can be used for example to calculate the day of the week for a given date:
{"%": [{"duration": [{"-": [{"date": "2025-02-10"}, {"date": "1978-01-01"}]}, "days"]}, 7]}
This returns:
1
In this calculation this represents Monday. This is because 1978-01-01 is a Sunday (0).
Curious to hear if you like this solution direction and if I can finish the PR.
Metadata
Metadata
Assignees
Labels
No labels