In my Pipeline, I have a “start date” and “end date.” The start date is {{ today.now }}. For the end date, I want the pipeline to add 5 business days to the start date. Is there a way to do that?
Solved
Jinja Question: Adding business days to today
Best answer by Mez
Here is how you can achieve this in jinja.
Using isoweekday Monday is 1 and Sunday is 7. (assumes exclusive)
{% if (time.now.date()).isoweekday() <= 5 %}
{{ time.now.date() + time.delta(days=7) }}
{% elif (time.now.date()).isoweekday() == 6 %}
{{ time.now.date() + time.delta(days=6) }}
{% else %}
{{ time.now.date() + time.delta(days=5) }}
{% endif %}
Sign up
Already have an account? Login
Login to the community
Login with Quickbase US – quickbase.com Login with Quickbase EU – quickbase.eu
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.