Skip to main content
Question

Jinja First Day of the Month

  • May 2, 2023
  • 0 replies
  • 509 views

Forum|alt.badge.img+15

I am trying to get a Jinja Expression to give me the First Day of the Month.   Searching the Help Section and web, the Replace function should work.

{{time.now|replace(day=1)}}

The error message I am getting is

Validation error: Incorrect template "{{time.now|replace(day=1)}}". TypeError: do_replace() got an unexpected keyword argument 'day'


There are plenty of Python references out there for this and Replace is listed in the QB Help.  I am sure it is a subtle syntax change to get the right output.




------------------------------
Don Larson
------------------------------

  • Registered
  • May 2, 2023

Hi Don,
I used the following syntax instead and was able to return the first day of the current month...

{{(time.now).replace(day=1)}}

Let me know if that one works for you!



------------------------------
Tyler Foster
Associate Developer
Synctivate Inc.
------------------------------