Forum Discussion

AidenPerez's avatar
AidenPerez
Qrew Member
11 months ago

Creating Arbitrary Dates with Jinja

Hey folks, so I'm trying to find the first monday of the month in my pipeline, and I'm struggling to find a way to insert my own info to create a date to work with. Here is the beginning of my current attempt, with the problem laying on getting firstDay into date format...

{% set firstDay = time.date(a.year, a.month, 1) %}

{% set weekday = firstDay.strftime("%w") %}

Would appreciate any help here with this, thanks in advance!



------------------------------
Aiden Perez
------------------------------

1 Reply

  • Hi, Aiden.  You didn't say what your final intended output is, so I'll just give some guidance on the first issue.

    FYI, this is the help page for working with dates and times:  https://helpv2.quickbase.com/hc/en-us/articles/4473004144660-Transforming-your-data-

    You want an absolute date, so:

    {% set firstDay = time.today + time.delta(year=a.year, month=a.month, day=1) %}

    Be mindful that a.year and  a.month exist. 

    Hope that helps!



    ------------------------------
    Tim Wise
    ------------------------------