Forum Discussion

ChristineWhite's avatar
ChristineWhite
Qrew Assistant Captain
10 months ago

Jinja Date functions

Hi,

Is anyone aware of a Jinja equivalent "Workday" function?  I am working on scheduling start dates based on a start date and # of work days needed to complete.  

Thank you!

 {{ a.Start_field + time.delta(days=a.workdays)}}

Or a day of the week function?  i.e. if Saturday I can add 2 days if Sunday add 1 day?



------------------------------
Christine White
------------------------------

3 Replies

  • I dont' believe QuickBase Jinja implementation has this atleast from the FAQ from their site.

    I would try to break the step in pipeline before i need the workday , update the record, let quickbase update the formula, copy the value & move forward .



    ------------------------------
    Prashant Maheshwari
    ------------------------------
  • ChristineWhite's avatar
    ChristineWhite
    Qrew Assistant Captain

    This worked! 

    {% set nextdate = b.install_start_counter + time.delta(days=d.install_days) %}
    {% if nextdate.strftime('%A')=='Saturday' %}
    nextdate + time.delta(days=2)
    {% elif nextdate.strftime('%A')=='Sunday' %}
    nextdate + time.delta(days=1)
    {% else %}
    nextdate
    {% endif %}



    ------------------------------
    Christine White
    ------------------------------

    • PrashantMaheshw's avatar
      PrashantMaheshw
      Qrew Captain

      Awesome ! Thanks for posting the solution .



      ------------------------------
      Prashant Maheshwari
      ------------------------------