The form has 2 fields of date fields
This form sets the value for field d2 to 15 days AFTER the d1
How the form looks like in the editor
Image Added
and the rule that sets the date in particular
Image Added | Image Added |
With "values to set" parameter set to
Code Block |
---|
d2=([entry.d1.timestamp] +1296000000) |
where 1296000000 is really 15*86400000 (15 days multiplied by milliseconds per day)
ConfiForms Form Definition |
---|
|
true
d1d1date d2d2date d1:[empty]d1=[now]Set value !d1:[empty]d2=([entry.d1.timestamp] +1296000000)Set valued1
|
Storage format for the solution
Expand |
---|
|
Code Block |
---|
<ac:structured-macro ac:macro-id="ddfa8bbd-a3e8-41a3-8df2-049cefe28d71" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f1</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="32c99bb3-be63-434c-8fd7-52b5055473a9" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:rich-text-body>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="b26e98b6-3cb4-4f52-9395-e60f5d349e80" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">d1</ac:parameter>
<ac:parameter ac:name="fieldLabel">d1</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="00cd10f9-bd01-4566-bc1f-9098f364fa5b" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">d2</ac:parameter>
<ac:parameter ac:name="fieldLabel">d2</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="5f453ca1-8d2d-472a-b4aa-a4c9a3b45339" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">d1:[empty]</ac:parameter>
<ac:parameter ac:name="values">d1=[now]</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8b95d332-e5c6-46ad-8b9a-80c5c8f085ad" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!d1:[empty]</ac:parameter>
<ac:parameter ac:name="values">d2=([entry.d1.timestamp] +1296000000)</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">d1</ac:parameter>
</ac:structured-macro>
</p>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro> |
|