This message was deleted.
# help
s
This message was deleted.
t
Hi Dan, I don’t think there’s a way to do durations in the templating language at this stage. You can do things like truncating and offsetting dates, but you always end up with another date value from these operations.
Adding an
{{interval}}
helper would make a great PR
👍 1
d
Excellent. Use case here is to be able to calculate upper and lower bounds when doing something like:
Copy code
# if either `joined_after` or `jointed_before` query parameters is present, response's `joined` key value should be with those bounds

# TODO 
# 1) calculate # of days difference between `now` and each query parameter
# 2) use calculated values as upper and lower bounds of randomInt

{{#assign 'dateOffset'}}-{{randomInt lower=1 upper=7300}} days{{/assign}}

{{#assign 'joinedDate'}}{{now offset=dateOffset format='yyyy-MM-dd'}}{{/assign}}