Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
docassemble/docassemble_base/docassemble/base/data/questions/examples/date-demo.yml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (25 sloc)
620 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata: | |
title: Date as object | |
documentation: "https://docassemble.org/docs/fields.html#date" | |
example start: 1 | |
example end: 3 | |
--- | |
question: | | |
When did you file the complaint? | |
fields: | |
- Date: date_of_filing | |
datatype: date | |
--- | |
code: | | |
response_deadline = date_of_filing.plus(days=20) | |
christmas = response_deadline.replace(month=12, day=25) | |
--- | |
mandatory: True | |
question: | | |
% if christmas > response_deadline: | |
Your response is due | |
${ int(date_difference(starting=date_of_filing, ending=christmas).weeks) } | |
weeks before Christmas. | |
% else: | |
Your response is due soon after Christmas! | |
% endif |