I have a docx template that is applying filters to dates. The dates are expected to be in string format MM-dd-yyyy.
I have a question that is using the date picker. It appears that filters are not being applied to dates.
question: |
Date
fields:
- Select Date: test_date
datatype: date
I added the metadata tag to set the default date format
metadata:
date format: "MM-dd-yyyy"
In my template I print the date along with using filters. The only thing that gets printed is the date.
{{test_date}}
{{test_date|filter}}
I know my filters work as if I remove the datatype from the question field and just put the date in as a string , ex 09-05-2025, they all work.
I have also figured out this workaround where I set the date to a temp variable and then use code to format it.
question: |
Date
fields:
- Select Date: temp_date
datatype: date
code: |
test_date = temp_date.format('MM-dd-yyyy')
What I don't understand is why simply setting the date format in the meta data doesn't produce the same result?
I have a docx template that is applying filters to dates. The dates are expected to be in string format MM-dd-yyyy.
I have a question that is using the date picker. It appears that filters are not being applied to dates.
question: |
Date
fields:
datatype: date
I added the metadata tag to set the default date format
metadata:
date format: "MM-dd-yyyy"
In my template I print the date along with using filters. The only thing that gets printed is the date.
{{test_date}}
{{test_date|filter}}
I know my filters work as if I remove the datatype from the question field and just put the date in as a string , ex 09-05-2025, they all work.
I have also figured out this workaround where I set the date to a temp variable and then use code to format it.
question: |
Date
fields:
datatype: date
code: |
test_date = temp_date.format('MM-dd-yyyy')
What I don't understand is why simply setting the date format in the meta data doesn't produce the same result?